Skip to content

Conversation

bzp2010
Copy link
Collaborator

@bzp2010 bzp2010 commented Oct 15, 2025

Description

Since Axios will directly throw errors, when a request fails (e.g., 400 Bad Request), the tap will not trigger and instead directly enter the catchError. This prevents request and response body information used for debugging from being logged.

The underlying reason is that rxjs tap does not subscribe to rxjs error. Therefore, once the stream data source directly throws an error, it will enter the first error subscriber, which is the catchError operator.

This PR ensures that debug information is printed in catchError whenever possible, even when requests fail. This applies unless the error itself is not an Axios error and the original response information cannot be obtained.

Checklist

  • I have explained the need for this PR and the problem it solves
  • I have explained the changes or the new features added to this PR
  • I have added tests corresponding to this change
  • I have updated the documentation to reflect this change
  • I have verified that this change is backward compatible

@bzp2010 bzp2010 added the test/apisix-standalone Trigger the APISIX standalone test on the PR label Oct 15, 2025
@bzp2010 bzp2010 requested a review from juzhiyuan October 15, 2025 11:54
@bzp2010 bzp2010 changed the title fix(apisix-standalone): log when requests fail fix(apisix-standalone): debug log when requests fail Oct 15, 2025
@bzp2010 bzp2010 requested a review from SkyeYoung October 15, 2025 11:58
@bzp2010 bzp2010 merged commit 005569a into main Oct 15, 2025
38 checks passed
@bzp2010 bzp2010 deleted the bzp/fix-bas-log-when-req-err branch October 15, 2025 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test/apisix-standalone Trigger the APISIX standalone test on the PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants