Repository navigation
fix(node): strip framing separator from bodyless errors - #64
Open
zakazaka95 wants to merge 1 commit into
Open
zakazaka95 wants to merge 1 commit into
zakazaka95 wants to merge 1 commit into
Conversation
Preserve the original error message when the native error tag has no response body. Cover every bodyless error kind, literal separators, UTF-8 bodies and synchronous/asynchronous client wrapping in the normal Node test runner. Co-authored-by: Codex <codex@openai.com>
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.
Bodyless Node SDK errors include a trailing
\u001fin their public message. The native binding appends this framing separator even when the tag has no response body, but the JavaScript parser previously removed it only for body-bearing errors.Remove exactly that final framing character for bodyless errors. Preserve embedded and literal trailing separators, legacy messages without the separator, error subclasses, and the existing UTF-8 byte-length handling for response bodies.
Add regression assertions to the normal Node test runner for all six bodyless kinds, Unicode and empty messages, body-bearing controls, JSON-RPC metadata, and synchronous/asynchronous client wrapping. The focused function can also run without the native extension; the default
npm teststill runs the existing native assertions after it.Validation:
fromNapiErrorandwrapClientmodules.npm cipasses; dependencies and lockfile are unchanged.npm run buildwas attempted and fails because Cargo is unavailable in this Windows environment. Normalnpm testpasses the new assertions, then fails to load the unavailable Windows native binding. The native suite is not claimed to pass; the existing Linux CI build/test path remains unchanged.No API requests, credentials, account operations, wallet generation, signing or payments were used. Prepared with AI assistance; the independent review was also performed by an AI agent.