Skip to content

Commit cebf0fb

Browse files
committed
added general javascript error catch
1 parent fc38a9f commit cebf0fb

File tree

2 files changed

+24
-0
lines changed
  • openid-connect-server-webapp/src/main/webapp/resources/js
  • uma-server-webapp/src/main/webapp/resources/js

2 files changed

+24
-0
lines changed

openid-connect-server-webapp/src/main/webapp/resources/js/admin.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1014,6 +1014,18 @@ $(function () {
10141014
});
10151015
});
10161016

1017+
window.onerror = function ( message, filename, lineno, colno, error ){
1018+
//Display an alert with an error message
1019+
$('#modalAlert div.modal-header').html($.t('error.title'));
1020+
$('#modalAlert div.modal-body').html($.t('error.message') + ' <br /> ' [filename, lineno, colno, error]);
1021+
1022+
$("#modalAlert").modal({ // wire up the actual modal functionality and show the dialog
1023+
"backdrop" : "static",
1024+
"keyboard" : true,
1025+
"show" : true // ensure the modal is shown immediately
1026+
});
1027+
1028+
}
10171029
});
10181030

10191031

uma-server-webapp/src/main/webapp/resources/js/admin.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1141,6 +1141,18 @@ $(function () {
11411141
});
11421142
});
11431143

1144+
window.onerror = function ( message, filename, lineno, colno, error ){
1145+
//Display an alert with an error message
1146+
$('#modalAlert div.modal-header').html($.t('error.title'));
1147+
$('#modalAlert div.modal-body').html($.t('error.message') + ' <br /> ' [filename, lineno, colno, error]);
1148+
1149+
$("#modalAlert").modal({ // wire up the actual modal functionality and show the dialog
1150+
"backdrop" : "static",
1151+
"keyboard" : true,
1152+
"show" : true // ensure the modal is shown immediately
1153+
});
1154+
1155+
}
11441156
});
11451157

11461158

0 commit comments

Comments
 (0)