]> git.wh0rd.org Git - tt-rss.git/commitdiff
misc exception handling improvements
authorAndrew Dolgov <fox@madoka.spb.ru>
Wed, 14 Dec 2005 07:29:38 +0000 (08:29 +0100)
committerAndrew Dolgov <fox@madoka.spb.ru>
Wed, 14 Dec 2005 07:29:38 +0000 (08:29 +0100)
feedlist.js
functions.js
viewfeed.js

index ead7948a1c6327c6467b30404f861dbde84417d0..e9310837958da8fc12327a768377ebc3b84f7661 100644 (file)
@@ -181,7 +181,7 @@ function toggleCollapseCat(cat) {
                xmlhttp_rpc.send(null);
 
        } catch (e) {
-               exception_error(e);
+               exception_error("toggleCollapseCat", e);
        }
 }
 
index f82708b29754b00bb473b50e7e4bdfbec88ebfaf..53cee530918a7b2bf72e496eaa46367f5302565e 100644 (file)
@@ -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);
        }
 }
 
index 7047aaae26035b8dd1da673956ca51e9d7a9af26..1d2c894ccb197dca2d25cfd96c560c5747410f11 100644 (file)
@@ -268,7 +268,7 @@ function selectionToggleUnread(cdm_mode) {
                }
 
        } catch (e) {
-               exception_error(e);
+               exception_error("selectionToggleUnread", e);
        }
 }
 
@@ -320,7 +320,7 @@ function selectionToggleMarked(cdm_mode) {
                }
 
        } catch (e) {
-               exception_error(e);
+               exception_error("selectionToggleMarked", e);
        }
 }