Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Improve output when receiving non-JSON from server #46

Merged
merged 1 commit into from

2 participants

@privman

I'm getting exceptions, apparently caused by the server returning non-JSON responses. In order to figure the root cause I need to see what the server's response is (I imagine it's a human-readable string describing the auth/connectivity/whatever issue).
This fix adds the raw response to the error output so that it's available post-mortem.

@norlin norlin merged commit 3377868 into felixge:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 20, 2012
  1. @privman
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/couchdb.js
View
2  lib/couchdb.js
@@ -226,7 +226,7 @@ exports.createClient = function(port, host, user, pass, maxListeners, secure) {
json = JSON.parse(buffer);
} catch (e) {
cbFired = true;
- return cb && cb(new Error('invalid json: '+json+" "+e.message));
+ return cb && cb(new Error('invalid json: "'+buffer+'". '+e.message));
}
if ('error' in json) {
Something went wrong with that request. Please try again.