Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[minor] fixes code from breaking when couch borks totally

  • Loading branch information...
commit 6ae41b2b08f2daf459f275c14e30c51ac1ecbf77 1 parent 705142d
@dscape authored
Showing with 6 additions and 1 deletion.
  1. +6 −1 nano.js
View
7 nano.js
@@ -286,7 +286,12 @@ module.exports = exports = nano = function database_module(cfg) {
}
else { // proxy the error directly from couchdb
log({err: 'couch', body: parsed, headers: rh});
- if (!parsed) { parsed = {}; }
+ if (!parsed) {
+ parsed = {};
+ }
+ if (typeof parsed === "string") { // a stacktrace from couch
+ parsed = {message: parsed};
+ }
if (!parsed.message && (parsed.reason || parsed.error)) {
parsed.message = (parsed.reason || parsed.error);
}
Please sign in to comment.
Something went wrong with that request. Please try again.