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 globalExceptionHandler(msg, url, linenumber) {
|
||||||
function setupGlobalExceptionHandler() {
|
|
||||||
if (!globalExceptionHandler) {
|
|
||||||
globalExceptionHandler = function test (msg, url, linenumber)
|
|
||||||
{
|
|
||||||
var errorId = randomString(20);
|
var errorId = randomString(20);
|
||||||
if ($("#editorloadingbox").attr("display") != "none"){
|
if ($("#editorloadingbox").attr("display") != "none"){
|
||||||
//show javascript errors to the user
|
//show javascript errors to the user
|
||||||
|
@ -522,8 +518,16 @@ function setupGlobalExceptionHandler() {
|
||||||
$.post(url, errObj);
|
$.post(url, errObj);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
};
|
}
|
||||||
|
|
||||||
|
var globalExceptionHandlerSetup = false;
|
||||||
|
function setupGlobalExceptionHandler() {
|
||||||
|
if (!globalExceptionHandlerSetup) {
|
||||||
|
globalExceptionHandlerSetup = true;
|
||||||
window.onerror = globalExceptionHandler;
|
window.onerror = globalExceptionHandler;
|
||||||
|
} else {
|
||||||
|
// no-op
|
||||||
|
// TODO: Throw an exception here.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue