mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-05-09 08:25:00 -04:00
Make exception handler static named function.
This commit is contained in:
parent
bd07589e0f
commit
723f75b016
1 changed files with 26 additions and 22 deletions
|
@ -500,11 +500,7 @@ var padutils = {
|
|||
}
|
||||
};
|
||||
|
||||
var globalExceptionHandler = undefined;
|
||||
function setupGlobalExceptionHandler() {
|
||||
if (!globalExceptionHandler) {
|
||||
globalExceptionHandler = function test (msg, url, linenumber)
|
||||
{
|
||||
function globalExceptionHandler(msg, url, linenumber) {
|
||||
var errorId = randomString(20);
|
||||
if ($("#editorloadingbox").attr("display") != "none"){
|
||||
//show javascript errors to the user
|
||||
|
@ -522,8 +518,16 @@ function setupGlobalExceptionHandler() {
|
|||
$.post(url, errObj);
|
||||
|
||||
return false;
|
||||
};
|
||||
}
|
||||
|
||||
var globalExceptionHandlerSetup = false;
|
||||
function setupGlobalExceptionHandler() {
|
||||
if (!globalExceptionHandlerSetup) {
|
||||
globalExceptionHandlerSetup = true;
|
||||
window.onerror = globalExceptionHandler;
|
||||
} else {
|
||||
// no-op
|
||||
// TODO: Throw an exception here.
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue