Uh oh!
There was an error while loading. Please reload this page.
Add entire response object on each request response - #14
Merged
Conversation
hitmanmcc
approved these changes
Mar 20, 2018
SandroMachado
requested changes
Mar 22, 2018
SandroMachado
left a comment
Contributor
There was a problem hiding this comment.
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); |
pgomforce-pushed
the
enhancement/error-handling
branch
from
March 22, 2018 17:37
aea82cf to
62cd3f6Comparepgomforce-pushed
the
enhancement/error-handling
branch
2 times, most recently
from
March 22, 2018 18:08
92df5be to
23d565dCompareSandroMachado
commented
Mar 22, 2018
Contributor
We need to add tests to cover this, right? |
pgomforce-pushed
the
enhancement/error-handling
branch
3 times, most recently
from
March 23, 2018 15:44
e50f014 to
ed6d838Compare| it('should create add an `response` attribute when provided', () => { | ||
| const error = createError({ status: 403 }, { foo: 'bar' }); | ||
| expect(error.response).toEqual({ foo: 'bar' }); |
Contributor
There was a problem hiding this comment.
WDYT of also check the error instance?
pgomforce-pushed
the
enhancement/error-handling
branch
from
March 23, 2018 16:20
ed6d838 to
eb3c581CompareSandroMachado
approved these changes
Mar 23, 2018
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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