Resolve "Communication Failed error"
Reported #1980 (closed) (underlying issue is something else)
This MR
- deal with the REPL exception hook when executed in the hub
- handle elogbook exceptions in the REPL exception hook
- add test for the REPL exception hook