Accessing the response data from a caught error on 500 #2314
Answered
by
sindresorhus
hardysabs2
asked this question in
Q&A
-
When axios throws (400/500 etc) you can access the data that was in the response here err.response.data I am struggling to find the response data in the caught error with got |
Beta Was this translation helpful? Give feedback.
Answered by
sindresorhus
Dec 1, 2023
Replies: 1 comment
-
The response data is available on the error, as per the docs: https://github.com/sindresorhus/got/blob/main/documentation/8-errors.md#errors |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
sindresorhus
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The response data is available on the error, as per the docs: https://github.com/sindresorhus/got/blob/main/documentation/8-errors.md#errors