From cebf0fb8b20866f32bec3826257662acd48838fd Mon Sep 17 00:00:00 2001 From: Justin Richer Date: Fri, 12 Feb 2016 17:32:35 -0500 Subject: [PATCH] added general javascript error catch --- .../src/main/webapp/resources/js/admin.js | 12 ++++++++++++ .../src/main/webapp/resources/js/admin.js | 12 ++++++++++++ 2 files changed, 24 insertions(+) diff --git a/openid-connect-server-webapp/src/main/webapp/resources/js/admin.js b/openid-connect-server-webapp/src/main/webapp/resources/js/admin.js index b6f840923..f14bfef45 100644 --- a/openid-connect-server-webapp/src/main/webapp/resources/js/admin.js +++ b/openid-connect-server-webapp/src/main/webapp/resources/js/admin.js @@ -1014,6 +1014,18 @@ $(function () { }); }); + window.onerror = function ( message, filename, lineno, colno, error ){ + //Display an alert with an error message + $('#modalAlert div.modal-header').html($.t('error.title')); + $('#modalAlert div.modal-body').html($.t('error.message') + '
' [filename, lineno, colno, error]); + + $("#modalAlert").modal({ // wire up the actual modal functionality and show the dialog + "backdrop" : "static", + "keyboard" : true, + "show" : true // ensure the modal is shown immediately + }); + + } }); diff --git a/uma-server-webapp/src/main/webapp/resources/js/admin.js b/uma-server-webapp/src/main/webapp/resources/js/admin.js index 6456ae550..1eb6848d8 100644 --- a/uma-server-webapp/src/main/webapp/resources/js/admin.js +++ b/uma-server-webapp/src/main/webapp/resources/js/admin.js @@ -1141,6 +1141,18 @@ $(function () { }); }); + window.onerror = function ( message, filename, lineno, colno, error ){ + //Display an alert with an error message + $('#modalAlert div.modal-header').html($.t('error.title')); + $('#modalAlert div.modal-body').html($.t('error.message') + '
' [filename, lineno, colno, error]); + + $("#modalAlert").modal({ // wire up the actual modal functionality and show the dialog + "backdrop" : "static", + "keyboard" : true, + "show" : true // ensure the modal is shown immediately + }); + + } });