Repository navigation
fix(repeater): always report a string errorCode for failed HTTP requests - #839
Merged
Merged
Conversation
The bridges classify a failed request by a Node.js-style string
errorCode. libcurl codes are already converted in curl.on('error'), but
other error sources still reach the execute() catch block unchanged: a
virtual script that throws an error with a numeric code was reported
with that number, and one that throws null or undefined made execute()
reject, so the bridges never got an answer.
Run numeric codes through CurlErrorMapper.toErrorCode, take only string
values for syscall and name, and return an error response for any
thrown value.
shevchenkov-neuralegion
approved these changes
Nov 30, 2026
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
HttpRequestExecutor.execute()now always reports a stringerrorCodefor a failed request, whatever the request fails on.The bridges classify a failed request by a Node.js-style string
errorCode(ETIMEDOUT,ECONNREFUSED, ...). #787 converts libcurl codes incurl.on('error'), but other error sources still reached the catch block inexecute()unchanged:codewas reported with that number in the ack, for exampleerrorCode: 28.nullorundefinedmade the catch block itself throw (Cannot destructure property 'cause').execute()rejected, the failure only went to Sentry and the bridges never got an answer for the request.The catch block now goes through
describeFailure(err: unknown):codegoes throughCurlErrorMapper.toErrorCode:28becomesETIMEDOUT, and an unmapped code becomes itsCURLE_*name.syscallandnameare used only when they are strings.causeis used only when it is an object, otherwise the error itself is read.message: String(err)and noerrorCode.WsRequestExecutoris unchanged.Verification
describe('execute', ...)fail onnextand pass with the fix:codefrom a script:28→'ETIMEDOUT',1→'CURLE_UNSUPPORTED_PROTOCOL';null,undefinedor a string:execute()returns an error response.tsc -p tsconfig.build.json, eslint and prettier.