mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -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 pgadmin.utils.versioned_template_loader import VersionedTemplateLoader
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
from pgadmin.setup import get_version, set_version
|
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
|
# If script is running under python3, it will not have the xrange function
|
||||||
# defined
|
# defined
|
||||||
@ -662,6 +664,11 @@ def create_app(app_name=None):
|
|||||||
'current_blueprint': current_blueprint
|
'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!
|
# All done!
|
||||||
##########################################################################
|
##########################################################################
|
||||||
|
@ -438,8 +438,8 @@ define('pgadmin.datagrid', [
|
|||||||
err.errormsg
|
err.errormsg
|
||||||
);
|
);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
alertify.alert(
|
alertify.alert(gettext('Query Tool Initialize Error'),
|
||||||
e.statusText, gettext('Query Tool Initialize Error')
|
e.statusText
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user