big-r81 commented on code in PR #5944:
URL: https://github.com/apache/couchdb/pull/5944#discussion_r4502833143
##########
share/server/util.js:
##########
@@ -120,6 +120,7 @@ var Couch = {
};
function errstr(e) {
+ if (e == null) return String(e);
Review Comment:
You know that e is `null, why do you return `String(e)`?
##########
share/server/views.js:
##########
@@ -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") {
Review Comment:
When `err` is null, you don't reach this line or?
##########
share/server/views.js:
##########
@@ -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") {
Review Comment:
see L73
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]