-
Couldn't load subscription status.
- Fork 22
Add entire response object on each request response #14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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.
We should change the base error to include the response. WDYT?
| expect(result.headers).toEqual({ 'biz-baz': 'buz' }); | ||
| expect(result.status).toBe(201); | ||
| expect(result.url).toBe('foo'); | ||
| expect(result.response).toEqual(result.response); |
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.
Fix this test.
aea82cf to
62cd3f6
Compare
92df5be to
23d565d
Compare
|
We need to add tests to cover this, right? |
e50f014 to
ed6d838
Compare
| it('should create add an `response` attribute when provided', () => { | ||
| const error = createError({ status: 403 }, { foo: 'bar' }); | ||
|
|
||
| expect(error.response).toEqual({ foo: 'bar' }); |
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.
WDYT of also check the error instance?
ed6d838 to
eb3c581
Compare
Description
This PR adds the entire request response to the provided object. This will be more useful for failed requests, making it easier to debug what went wrong for that request.
Related issues