if (Config.get("errorHandler") != null && exception != null) {
Class<? extends IErrorHandler> c = (Class<? extends IErrorHandler>) Config.get("errorHandler").getClass();
try {
IErrorHandler handler = (IErrorHandler) c.newInstance();
handler.setException(exception);
httpResponse.clearContent();
dispatchModule(handler, httpRequest, httpResponse, "error");
} catch (Exception ex) {
httpResponse.setStatus(500);
httpResponse.setException(ex);
}