add listeners and a handler for exception events. unit tests for same