Skip to content

[BR-1794]: restructure error headers into response object#360

Closed
terrerox wants to merge 1 commit intomasterfrom
feature/add-error-headers
Closed

[BR-1794]: restructure error headers into response object#360
terrerox wants to merge 1 commit intomasterfrom
feature/add-error-headers

Conversation

@terrerox
Copy link
Contributor

@terrerox terrerox commented Feb 4, 2026

Modified AppError class to nest headers within a response object for better consistency with standard HTTP error patterns.

@terrerox terrerox self-assigned this Feb 4, 2026
@terrerox terrerox requested a review from CandelR February 4, 2026 03:30
@terrerox terrerox changed the title [BR-1794]: restructure AppError to include response headers in a nested object [BR-1794]: restructure error headers into response object Feb 4, 2026
this.status = status;
this.code = code;
this.headers = headers;
this.response = headers ? { headers } : undefined;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor Author

@terrerox terrerox Feb 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 :)

@terrerox terrerox requested a review from CandelR February 4, 2026 13:29
@terrerox terrerox closed this Feb 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants