prismatic-io / spectral

Prismatic's typescript library for custom components
https://prismatic.io/docs/spectral/custom-component-library
35 stars 2 forks source link

Add HTTP status code and response headers to error handler #191

Closed taylorreece closed 5 months ago

taylorreece commented 5 months ago

When an error is thrown by Axios, it's handy to have access to the HTTP status and response headers returned from the API, without needing to parse the HTTP status code from the error message.

This makes it so when HTTP responses are caught by the generic HTTP client's handleErrors function, the response's status code and headers are included alongside the response's data in the error that is yielded.

image

That'll make step-level error handling easier.