linterna-magica-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[linterna-magica-commit] [230] Sometimes Firefox throws an exception, co


From: Ivaylo Valkov
Subject: [linterna-magica-commit] [230] Sometimes Firefox throws an exception, complaining about undefined console object.
Date: Thu, 01 Dec 2011 11:35:43 +0000

Revision: 230
          
http://svn.sv.gnu.org/viewvc/?view=rev&root=linterna-magica&revision=230
Author:   valkov
Date:     2011-12-01 11:35:42 +0000 (Thu, 01 Dec 2011)
Log Message:
-----------
Sometimes Firefox throws an exception, complaining about undefined console 
object. This change catches the exception and disables logging.

Modified Paths:
--------------
    trunk/src/lm_log.js

Modified: trunk/src/lm_log.js
===================================================================
--- trunk/src/lm_log.js 2011-12-01 09:56:43 UTC (rev 229)
+++ trunk/src/lm_log.js 2011-12-01 11:35:42 UTC (rev 230)
@@ -32,7 +32,7 @@
 LinternaMagica.prototype.log = function(message, level)
 {
     // No debug set by the user
-    if (!this.debug_level)
+    if (!this.debug_level || this.disabled_log)
     {
        return;
     }
@@ -111,7 +111,16 @@
        }
        catch(e)
        {
-           console.log(log_string);
+           try
+           {
+               console.log(log_string);
+           }
+           catch(e)
+           {
+               alert("Linterna Mágica: Unexpected error occured."+
+                     "Disabling log.\n\nException: "+e);
+               this.disabled_log = true;
+           }
        }
     }
 }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]