[BR-1794]: restructure error headers into response object#360
[BR-1794]: restructure error headers into response object#360
Conversation
| this.status = status; | ||
| this.code = code; | ||
| this.headers = headers; | ||
| this.response = headers ? { headers } : undefined; |
There was a problem hiding this comment.
This change could affect all projects that use it. If drive-web handles it correctly because the SDK is designed this way, there is no problem; leave it as it is for now or adapt it to coexist for a period of time and mark the old way as deprecated so that it can be adapted
There was a problem hiding this comment.
It won’t affect other projects because I added the headers recently, and the change exists only in the current version. Since other error.response cases are handled this way in the SDK, we can leave it as is and close the PR
There was a problem hiding this comment.
Ah, you added it recently, sorry!
In any case, perhaps we can leave it as you say, because that's how it's handled in the SDK, and it won't be consistent with Axios' official documentation if we add the response to the status level. So that's fine, we'll leave it like that if you agree :)
Modified AppError class to nest headers within a response object for better consistency with standard HTTP error patterns.