fix(billing): propagate upstream status from tx-signer errors#3039
fix(billing): propagate upstream status from tx-signer errors#3039ygrishajev wants to merge 1 commit intomainfrom
Conversation
Preserve AxiosError as cause when ExternalSignerHttpSdkService rethrows so ChainErrorService can extract the upstream status code. 5xx responses from the tx-signer are now returned as-is instead of falling through to 500.
|
Caution Review failedAn error occurred during the review process. Please try again later. 📝 WalkthroughWalkthroughThese changes enhance error handling in the billing services by introducing upstream HTTP status code extraction from error causes. A new helper method extracts 5xx status codes from nested Axios errors, transforming them into appropriate HTTP error objects. Error propagation is updated to preserve original error causes throughout the call chain, with comprehensive test coverage for the new transformation logic. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3039 +/- ##
==========================================
- Coverage 59.63% 58.81% -0.83%
==========================================
Files 1034 996 -38
Lines 24248 23357 -891
Branches 6009 5873 -136
==========================================
- Hits 14461 13738 -723
+ Misses 8536 8380 -156
+ Partials 1251 1239 -12
*This pull request uses carry forward flags. Click here to find out more.
🚀 New features to boost your workflow:
|
Why
When the tx-signer returns a 5xx error (e.g. 502), the API wraps it in a plain
Errorlosing the status code. The error handler then defaults to 500, making it impossible to distinguish upstream failures from internal API errors.What
ExternalSignerHttpSdkService: preserve the originalAxiosErrorascausewhen rethrowingChainErrorService: extract upstream status fromerror.causewhen no chain error clue matches — 5xx statuses are propagated as-is, 4xx are left unhandledSummary by CodeRabbit
Tests
Chores