Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make try_ fns return smaller SDK error type #1175

Merged
merged 10 commits into from
Nov 23, 2023
Merged

Make try_ fns return smaller SDK error type #1175

merged 10 commits into from
Nov 23, 2023

Conversation

leighmcculloch
Copy link
Member

@leighmcculloch leighmcculloch commented Nov 22, 2023

What

Make try_ fns return smaller SDK error type instead of the large host error type.

Why

The host error type contains a massive number of possible errors. However, the host obfuscates the error when it is passed to the guest, and so the guest and sdk only ever see the Context/InvalidAction error.

It's confusing for developers if we expose the host error type, then don't actually surface most of the errors on it. A developer might think they can distingish between different error states, when in reality they cannot.

Close #1136

@leighmcculloch leighmcculloch marked this pull request as ready for review November 22, 2023 07:20
soroban-sdk/src/error.rs Outdated Show resolved Hide resolved
soroban-sdk/src/error.rs Outdated Show resolved Hide resolved
soroban-sdk/src/error.rs Outdated Show resolved Hide resolved
@leighmcculloch leighmcculloch added this pull request to the merge queue Nov 22, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 22, 2023
@leighmcculloch leighmcculloch added this pull request to the merge queue Nov 23, 2023
Merged via the queue into main with commit 464fb58 Nov 23, 2023
@leighmcculloch leighmcculloch deleted the i1136 branch November 23, 2023 03:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Try_ fns return host Errors but should return smaller subset
2 participants