summaryrefslogtreecommitdiff
path: root/functions.js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2005-12-14 08:29:38 +0100
committerAndrew Dolgov <[email protected]>2005-12-14 08:29:38 +0100
commit83f043bb941b40ba0e5c6b29d01776e92db5936c (patch)
tree0efc995ebfa221edac15b8e3fd29d590a7ea8862 /functions.js
parent672366bdf7ee771f9855f2f773487d72fae57c57 (diff)
misc exception handling improvements
Diffstat (limited to 'functions.js')
-rw-r--r--functions.js19
1 files changed, 15 insertions, 4 deletions
diff --git a/functions.js b/functions.js
index f82708b29..53cee5309 100644
--- a/functions.js
+++ b/functions.js
@@ -1,8 +1,19 @@
var hotkeys_enabled = true;
function exception_error(location, e) {
- alert("Exception: " + e.name + "\nMessage: " + e.message +
- "\nLocation: " + location);
+ var msg;
+
+ if (e.fileName) {
+ var base_fname = e.fileName.substring(e.fileName.lastIndexOf("/") + 1);
+
+ msg = "Exception: " + e.name + ", " + e.message +
+ "\nFunction: " + location + "()" +
+ "\nLocation: " + base_fname + ":" + e.lineNumber;
+ } else {
+ msg = "Exception: " + e + "\nFunction: " + location + "()";
+ }
+
+ alert(msg);
}
function disableHotkeys() {
@@ -133,7 +144,7 @@ function hotkey_handler(e) {
try {
localHotkeyHandler(keycode);
} catch (e) {
- exception_error(e);
+ exception_error("hotkey_handler", e);
}
}
@@ -395,7 +406,7 @@ function parse_counters(reply, f_document) {
}
}
} catch (e) {
- exception_error(e);
+ exception_error("parse_counters", e);
}
}