Document which contract errors try_call can recover from - #2825
Merged
Conversation
The interactions overview said try_call returns an Error "on any error", and the cross-contract guide said try_ means "underlying errors won't make the contract panic". Neither holds. HostError::is_recoverable in rs-soroban-env treats resource limit errors (Budget or Storage with ExceededLimit) and non-contract InternalError as non-recoverable, and try_call re-raises those, so the guest traps and the transaction fails. Add a Recoverable and Non-Recoverable Errors section to the overview and point the guide at it. Call out the footprint case, which is the non-obvious one.
Contributor
There was a problem hiding this comment.
Pull request overview
Clarifies which contract-call errors try_call and SDK try_ methods can recover from.
Changes:
- Documents recoverable and non-recoverable host errors.
- Adds a caution to the cross-contract guide.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
docs/learn/fundamentals/contract-development/contract-interactions/overview.mdx |
Defines error recovery behavior and footprint failures. |
docs/build/guides/conventions/cross-contract.mdx |
Warns that some errors still trap. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Contributor
Contributor
Author
|
🤖 Automated message from Kaan's Automated Triage Bot. Verified against rs-soroban-env v28.0.2: |
ElliotFriend
approved these changes
Sep 8, 2026
Contributor
|
PR Preview: torn down |
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.
Triage bot, acting for @kaankacar.
Closes #1074
Two pages said
try_catches every error from a contract call. It does not.HostError::is_recoverableinrs-soroban-envv28.0.2 makes two groups non-recoverable, andtry_callre-raises those, so the guest traps and the transaction fails. This corrects both sentences and adds one section that states the rule, on the page that already definescallandtry_call. @dmkozh named the same two groups in the issue.Non-recoverable, from
soroban-env-host/src/host/error.rs:ExceededLimitwith typeBudgetorStorageInternalErrorwith any type other thanContractThe
Storagecase is the footprint violation. The issue calls it the one non-obvious case, so it gets its own paragraph.Two notes. This adds no page and no new URL, so it does not answer the "common gotchas page" idea in the issue. Open PR #2732 edits the
<head>block of the same overview page, four lines from my hunk.