Skip to content

Commit

Permalink
Merge pull request #18 from ali-sdk/error-params
Browse files Browse the repository at this point in the history
feat: request error add params info
  • Loading branch information
fengmk2 committed Aug 22, 2015
2 parents 1998560 + 2cf9583 commit 3f6e8bd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 4 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
sudo: false
language: node_js

node_js:
- iojs-2
- iojs-1
- '3'
- '2'
- '1'
- '0.12'

env:
Expand Down
4 changes: 3 additions & 1 deletion lib/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,9 @@ proto.request = function* (params) {
var result = yield urllib.requestThunk(reqParams.url, reqParams.params);
debug('response %s %s, got %s, headers: %j', params.method, reqParams.url, result.status, result.headers);
if (params.successStatuses && params.successStatuses.indexOf(result.status) === -1) {
throw yield* this.requestError(result);
var err = yield* this.requestError(result);
err.params = params;
throw err;
}
if (params.xmlResponse) {
result.data = yield this.parseXML(result.data);
Expand Down

0 comments on commit 3f6e8bd

Please sign in to comment.