-
Notifications
You must be signed in to change notification settings - Fork 298
refactor: convert config API to async await #1155
Conversation
…wait License: MIT Signed-off-by: Alan Shaw <alan.shaw@protocol.ai>
expect(err.message).to.eql('boom') | ||
expect(err.status).to.eql(500) | ||
expect(err.response.status).to.eql(500) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Breaking change? I guess errors aren't really part of the spec other than 'you will get an error'.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it is breaking. I've updated the PR description with the info and will include it when merging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great. One small thing - the description says err.status
has changed but it's err.statusCode
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well this test was looking for .status
but others are looking for .statusCode
...I've added both to the breaking change message.
BREAKING CHANGE: Errors returned from request failures are now all
HTTPError
s which carry aresponse
property. This is aResponse
that can be used to inspect all information relating to the HTTP response. This means that theerr.status
orerr.statusCode
property should now be accessed viaerr.response.status
.