You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 11, 2023. It is now read-only.
I'm currently trying to make my post request handle a specific error message. The response body of the error message is fine through postman, but the output of the error to the console is:
which is the correct response, but the body is a readable stream. I can access the body by reading this stream, but it's clunky. I'd like to be able to just output my error.data.body.
Perhaps I'm just running my request wrong. Here's how it's formatted:
constaddType=useAddType({});// generated post function for API named AddType that takes in a nameaddType.mutate({name: "testName"}).then(res=>{console.log(res);}).catch(err=>{console.log(err);// contains a body with a more detailed error message})
This request works fine, I just can't access the body of the error.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I'm currently trying to make my post request handle a specific error message. The response body of the error message is fine through postman, but the output of the error to the console is:
which is the correct response, but the body is a readable stream. I can access the body by reading this stream, but it's clunky. I'd like to be able to just output my error.data.body.
Perhaps I'm just running my request wrong. Here's how it's formatted:
This request works fine, I just can't access the body of the error.
The text was updated successfully, but these errors were encountered: