diff options
author | John Christopher Anderson <jchris@apache.org> | 2009-01-03 22:22:56 +0000 |
---|---|---|
committer | John Christopher Anderson <jchris@apache.org> | 2009-01-03 22:22:56 +0000 |
commit | 278e66875153447651b1e30adeb7781d0e10854d (patch) | |
tree | b6d97bb6080857ee4485cf968e2e05965c83309a /share | |
parent | 29885f56dd073c1dc2f573fdd42a496194005cc6 (diff) |
Slight improvement in forms error logging. When this is solid I will standardize it across main.js
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@731110 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'share')
-rw-r--r-- | share/server/main.js | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/share/server/main.js b/share/server/main.js index dfb0a403..0302721e 100644 --- a/share/server/main.js +++ b/share/server/main.js @@ -344,9 +344,15 @@ while (cmd = eval(readline())) { 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: |