mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2024-11-26 02:30:21 -06:00
Improve application level exception handling for unhandled exceptions.
This commit is contained in:
parent
fcfe0929d3
commit
1f29859040
@ -34,6 +34,8 @@ from pgadmin.utils.session import create_session_interface, pga_unauthorised
|
||||
from pgadmin.utils.versioned_template_loader import VersionedTemplateLoader
|
||||
from datetime import timedelta
|
||||
from pgadmin.setup import get_version, set_version
|
||||
from pgadmin.utils.ajax import internal_server_error
|
||||
|
||||
|
||||
# If script is running under python3, it will not have the xrange function
|
||||
# defined
|
||||
@ -662,6 +664,11 @@ def create_app(app_name=None):
|
||||
'current_blueprint': current_blueprint
|
||||
}
|
||||
|
||||
@app.errorhandler(Exception)
|
||||
def all_exception_handler(e):
|
||||
current_app.logger.error(e, exc_info=True)
|
||||
return internal_server_error(errormsg=str(e))
|
||||
|
||||
##########################################################################
|
||||
# All done!
|
||||
##########################################################################
|
||||
|
@ -438,8 +438,8 @@ define('pgadmin.datagrid', [
|
||||
err.errormsg
|
||||
);
|
||||
} catch (e) {
|
||||
alertify.alert(
|
||||
e.statusText, gettext('Query Tool Initialize Error')
|
||||
alertify.alert(gettext('Query Tool Initialize Error'),
|
||||
e.statusText
|
||||
);
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user