Adds error logging in rescue_unhandled_exception.