From b2eb1b381480d727f4ad7d2001ece661e4d497d1 Mon Sep 17 00:00:00 2001 From: John McLear Date: Tue, 26 Feb 2013 13:14:17 +0000 Subject: [PATCH 1/2] post url with pad error msg --- src/static/js/pad_utils.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/static/js/pad_utils.js b/src/static/js/pad_utils.js index 82f7fcada..ea4157bf3 100644 --- a/src/static/js/pad_utils.js +++ b/src/static/js/pad_utils.js @@ -514,18 +514,18 @@ function setupGlobalExceptionHandler() { if (!globalExceptionHandler) { globalExceptionHandler = function test (msg, url, linenumber) { + var loc = document.location; var errorId = randomString(20); if ($("#editorloadingbox").attr("display") != "none"){ //show javascript errors to the user $("#editorloadingbox").css("padding", "10px"); $("#editorloadingbox").css("padding-top", "45px"); $("#editorloadingbox").html("
An error occured
The error was reported with the following id: '" + errorId + "'

Please send this error message to us:
'" - + "ErrorId: " + errorId + "
UserAgent: " + navigator.userAgent + "
" + msg + " in " + url + " at line " + linenumber + "'
"); + + "ErrorId: " + errorId + "
URL: " + loc + "
UserAgent: " + navigator.userAgent + "
" + msg + " in " + url + " at line " + linenumber + "'"); } //send javascript errors to the server - var errObj = {errorInfo: JSON.stringify({errorId: errorId, msg: msg, url: url, linenumber: linenumber, userAgent: navigator.userAgent})}; - var loc = document.location; + var errObj = {errorInfo: JSON.stringify({errorId: errorId, url: loc, msg: msg, url: url, linenumber: linenumber, userAgent: navigator.userAgent})}; var url = loc.protocol + "//" + loc.hostname + ":" + loc.port + "/" + loc.pathname.substr(1, loc.pathname.indexOf("/p/")) + "jserror"; $.post(url, errObj); From ad52b40597185bf69efc82c99b0e01edbb8ec5ee Mon Sep 17 00:00:00 2001 From: John McLear Date: Tue, 26 Feb 2013 13:24:24 +0000 Subject: [PATCH 2/2] post correct url, heh --- src/static/js/pad_utils.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/static/js/pad_utils.js b/src/static/js/pad_utils.js index ea4157bf3..deee2dfd4 100644 --- a/src/static/js/pad_utils.js +++ b/src/static/js/pad_utils.js @@ -514,18 +514,18 @@ function setupGlobalExceptionHandler() { if (!globalExceptionHandler) { globalExceptionHandler = function test (msg, url, linenumber) { - var loc = document.location; var errorId = randomString(20); if ($("#editorloadingbox").attr("display") != "none"){ //show javascript errors to the user $("#editorloadingbox").css("padding", "10px"); $("#editorloadingbox").css("padding-top", "45px"); $("#editorloadingbox").html("
An error occured
The error was reported with the following id: '" + errorId + "'

Please send this error message to us:
'" - + "ErrorId: " + errorId + "
URL: " + loc + "
UserAgent: " + navigator.userAgent + "
" + msg + " in " + url + " at line " + linenumber + "'
"); + + "ErrorId: " + errorId + "
URL: " + window.location.href + "
UserAgent: " + navigator.userAgent + "
" + msg + " in " + url + " at line " + linenumber + "'"); } //send javascript errors to the server - var errObj = {errorInfo: JSON.stringify({errorId: errorId, url: loc, msg: msg, url: url, linenumber: linenumber, userAgent: navigator.userAgent})}; + var errObj = {errorInfo: JSON.stringify({errorId: errorId, msg: msg, url: window.location.href, linenumber: linenumber, userAgent: navigator.userAgent})}; + var loc = document.location; var url = loc.protocol + "//" + loc.hostname + ":" + loc.port + "/" + loc.pathname.substr(1, loc.pathname.indexOf("/p/")) + "jserror"; $.post(url, errObj);