refactor Application::handle and fire events on exception handling