Skip to content

Commit

Permalink
Stringify wsdl-related error messages to avoid non-descriptive [objec…
Browse files Browse the repository at this point in the history
…t Object] output. (#1037)
  • Loading branch information
barboni authored and jsdevel committed Feb 12, 2019
1 parent 63bd7b7 commit 570f5b3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/wsdl.js
Expand Up @@ -1561,7 +1561,7 @@ WSDL.prototype.xmlToObject = function(xml, callback) {
string = string || body.Fault.faultstring;
detail = detail || body.Fault.detail;

var error = new Error(code + ': ' + string + (detail ? ': ' + detail : ''));
var error = new Error(code + ': ' + string + (detail ? ': ' + JSON.stringify(detail) : ''));

error.root = root;
throw error;
Expand Down
2 changes: 1 addition & 1 deletion test/client-test.js
Expand Up @@ -820,7 +820,7 @@ var fs = require('fs'),
server.close();
server = null;
assert.ok(err);
assert.strictEqual(err.message, 'Test: test error: test detail');
assert.strictEqual(err.message, 'Test: test error: "test detail"');
assert.ok(result);
assert.ok(body);
done();
Expand Down

0 comments on commit 570f5b3

Please sign in to comment.