couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jch...@apache.org
Subject svn commit: r731110 - /couchdb/trunk/share/server/main.js
Date Sat, 03 Jan 2009 22:22:56 GMT
Author: jchris
Date: Sat Jan  3 14:22:56 2009
New Revision: 731110

URL: http://svn.apache.org/viewvc?rev=731110&view=rev
Log:
Slight improvement in forms error logging. When this is solid I will standardize it across
main.js

Modified:
    couchdb/trunk/share/server/main.js

Modified: couchdb/trunk/share/server/main.js
URL: http://svn.apache.org/viewvc/couchdb/trunk/share/server/main.js?rev=731110&r1=731109&r2=731110&view=diff
==============================================================================
--- couchdb/trunk/share/server/main.js [utf-8] (original)
+++ couchdb/trunk/share/server/main.js [utf-8] Sat Jan  3 14:22:56 2009
@@ -344,9 +344,15 @@
           var rendered = formFun(doc, req);
           print(toJSON(rendered));
         } catch (error) {
+          // Available error fields: 
+          // message, fileName, lineNumber, stack, name
           log("form function raised error: "+error.toString());
-          log({error:(error||"undefined error")});
-          print(toJSON(error));
+          log("stacktrace: "+error.stack);
+          try {
+            print(toJSON(error));            
+          } catch (e) {
+            print({"error":error.toString()});
+          }
         }
         break;
       default:



Mime
View raw message