It might be better to simply enable setting of an ErrorHandler.