Skip to content

Commit

Permalink
Merge pull request #7 from terascope/master
Browse files Browse the repository at this point in the history
better error parsing for open
  • Loading branch information
ryancole authored Apr 12, 2017
2 parents fe59f51 + bbdbb89 commit 4afc88e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/webhdfs.js
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,7 @@ WebHDFSClient.prototype.open = function (path, hdfsoptions, requestoptions, call

// format request args
var args = _.defaults({
json: true,
uri: this.base_url + path,
qs: _.defaults({
op: 'open'
Expand All @@ -330,7 +331,10 @@ WebHDFSClient.prototype.open = function (path, hdfsoptions, requestoptions, call

// forward request error
if (error) return callback(error);


if (typeof body === 'object' && 'RemoteException' in body){
return callback(new RemoteException(body));
}
// execute callback
return callback(null, body);

Expand Down

0 comments on commit 4afc88e

Please sign in to comment.