fix(http-client): surface SAP OData error body in HttpRequestError#6624
Closed
m-zandi wants to merge 1 commit into
Closed
fix(http-client): surface SAP OData error body in HttpRequestError#6624m-zandi wants to merge 1 commit into
m-zandi wants to merge 1 commit into
Conversation
|
|
Member
|
Thank you for the PR. The implementation of this PR does not seem to be complete and does not appear to fully match the description, as such I am closing the PR. Please feel free to open an issue to discuss any changes you wish to make. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does
Fixes silent loss of SAP OData/REST error response bodies when
executeHttpRequest() encounters a non-2xx HTTP status.
Problem
When SAP APIs return structured error bodies (OData v2/v4 envelopes),
the error information was silently discarded. Callers received a raw
Axios error with no access to the SAP error code or message.
Solution
HttpRequestErrorclass exposes:statusCode,responseBody,causeenvelopes (
{ error: { message: { value: "..." } } })executeHttpRequestwraps Axios errors withHttpRequestErrorwhen aresponse is present; network/timeout errors are re-thrown unchanged
Breaking changes
None.
HttpRequestErrorextendsError, so existingcatch(e)blockscontinue to work. The new class is purely additive.
Checklist