Repository navigation
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues block approval of the change to preserve non-contract error types.
No open issues 🎉
What changed in this PR
Fixes #1905 by preserving non-contract error types in scValToNative() results, allowing SDK consumers to distinguish failures such as storage and budget errors through humanizeEvents().
Changes:
- Adds
errorTypeto system errors while preserving existing fields and the contract-error shape. - Adds regression tests for all nine non-contract error types and diagnostic event topics.
- Documents the result shape and its effect on whole-object comparisons.
| File | Description |
|---|---|
test/unit/base/scval.test.ts |
Tests all non-contract error types and unchanged contract-error output. |
test/unit/base/events.test.ts |
Tests preservation of storage and budget error types in event topics. |
src/base/scval.ts |
Returns and documents errorType for non-contract errors. |
docs/reference/core-soroban-primitives.md |
Updates reference documentation and source links. |
CHANGELOG.md |
Records the fix and compatibility considerations. |
Review effort: Balanced
quietbits
approved these changes
Nov 24, 2026
This branch has not been deployed
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
scValToNative()adds anerrorTypefield, such as"sceStorage", to the result for anscvErrorthat is not a contract error.humanizeEvents()gets it too, since it callsscValToNative()on topics and data.The
type,codeandvaluefields are unchanged, and a contract error is still{ type: "contract", code }.Why
Errors with the same code and different types gave the same result.
Error(Storage, ExceededLimit)andError(Budget, ExceededLimit)both became{ type: "system", code: 5, value: "scecExceededLimit" }, so a caller could not tell why a transaction failed.Fixes #1905