Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions share/server/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ var Couch = {
};

function errstr(e) {
if (e == null) return String(e);
// toSource() is a Spidermonkey "special"
return (e.toSource ? e.toSource() : e.toString());
};
Expand Down
4 changes: 2 additions & 2 deletions share/server/views.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ var Views = (function() {
// JavaScript process. If you need to destroy the JavaScript
// process, throw the error form matched by the block below.
throw(["error", "map_runtime_error", "function raised 'fatal_error'"]);
} else if (err[0] == "fatal") {
} else if (err && err[0] == "fatal") {
// Throwing errors of the form ["fatal","error_key","reason"]
// will kill the OS process. This is not normally what you want.
throw(err);
} else if (err.name == "InternalError") {
} else if (err && err.name == "InternalError") {
throw(["fatal", err.name, err.message]);
}
var message = "function raised exception " + errstr(err);
Expand Down