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

3/n improve sui-json-rpc error codes and handling #11928

Merged
merged 1 commit into from
May 16, 2023
Merged

Conversation

wlmyng
Copy link
Contributor

@wlmyng wlmyng commented May 11, 2023

Description

Replace anyhow errors with Error enum on sui-json-rpc where possible

Test Plan

How did you test the new or updated feature?


If your changes are not user-facing and not a breaking change, you can skip the following section. Otherwise, please indicate what changed, and then add to the Release Notes section as highlighted during the release process.

Type of Change (Check all that apply)

  • user-visible impact
  • breaking change for a client SDKs
  • breaking change for FNs (FN binary must upgrade)
  • breaking change for validators or node operators (must upgrade binaries)
  • breaking change for on-chain data layout
  • necessitate either a data wipe or data migration

Release notes

[API behavioral changes] - rpc methods that result in errors of variant UserInputError, SuiRpcInputError, SuiError::TransactionNotFound or SuiError::TransactionsNotFound now return error code -32602 instead of -32000.

@vercel
Copy link

vercel bot commented May 11, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
explorer ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 16, 2023 7:23pm
explorer-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 16, 2023 7:23pm
offline-signer-helper ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 16, 2023 7:23pm
sui-wallet-kit ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 16, 2023 7:23pm
wallet-adapter ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 16, 2023 7:23pm

@wlmyng wlmyng force-pushed the better-error-handling-2 branch from a08d409 to 8d6bb51 Compare May 12, 2023 01:57
@wlmyng wlmyng force-pushed the better-error-handling-3 branch from a2b85e3 to 78474a6 Compare May 12, 2023 02:06
Base automatically changed from better-error-handling-2 to main May 12, 2023 04:29
@wlmyng wlmyng force-pushed the better-error-handling-3 branch from 78474a6 to 9a5c43b Compare May 12, 2023 20:24
@wlmyng wlmyng changed the title Replace anyhow errors with Error enum on sui-json-rpc where possible 3/n improve sui-json-rpc error codes and handling May 12, 2023
@wlmyng wlmyng force-pushed the better-error-handling-3 branch 3 times, most recently from e43e266 to 2d14b52 Compare May 12, 2023 23:52
@wlmyng wlmyng force-pushed the better-error-handling-3 branch 2 times, most recently from 3a68c7a to fc79272 Compare May 15, 2023 20:17
@vercel vercel bot temporarily deployed to Preview – wallet-adapter May 15, 2023 20:34 Inactive
@vercel vercel bot temporarily deployed to Preview – explorer-storybook May 15, 2023 20:34 Inactive
@vercel vercel bot temporarily deployed to Preview – sui-wallet-kit May 15, 2023 20:34 Inactive
Copy link
Contributor

@healthydeve healthydeve left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor nits on wording

@vercel vercel bot temporarily deployed to Preview – wallet-adapter May 16, 2023 16:20 Inactive
@vercel vercel bot temporarily deployed to Preview – sui-wallet-kit May 16, 2023 16:20 Inactive
@vercel vercel bot temporarily deployed to Preview – explorer-storybook May 16, 2023 16:21 Inactive
@wlmyng wlmyng force-pushed the better-error-handling-3 branch from 3cb2856 to 4c5bb5d Compare May 16, 2023 16:47
@vercel vercel bot temporarily deployed to Preview – sui-wallet-kit May 16, 2023 16:47 Inactive
@vercel vercel bot temporarily deployed to Preview – explorer-storybook May 16, 2023 16:48 Inactive
@vercel vercel bot temporarily deployed to Preview – explorer-storybook May 16, 2023 16:51 Inactive
@vercel vercel bot temporarily deployed to Preview – sui-wallet-kit May 16, 2023 16:51 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-adapter May 16, 2023 16:52 Inactive
@wlmyng wlmyng force-pushed the better-error-handling-3 branch from ce4985b to b305dcb Compare May 16, 2023 18:45
@vercel vercel bot temporarily deployed to Preview – sui-wallet-kit May 16, 2023 18:46 Inactive
@vercel vercel bot temporarily deployed to Preview – explorer-storybook May 16, 2023 18:46 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-adapter May 16, 2023 18:46 Inactive
@wlmyng wlmyng force-pushed the better-error-handling-3 branch from b305dcb to ac46169 Compare May 16, 2023 18:47
@vercel vercel bot temporarily deployed to Preview – wallet-adapter May 16, 2023 18:48 Inactive
@vercel vercel bot temporarily deployed to Preview – sui-wallet-kit May 16, 2023 18:49 Inactive
@vercel vercel bot temporarily deployed to Preview – explorer-storybook May 16, 2023 18:49 Inactive
governance api

coin api

purge anyhow from transaction_execution_api
@wlmyng wlmyng force-pushed the better-error-handling-3 branch from 85d0068 to 029bb40 Compare May 16, 2023 19:22
@vercel vercel bot temporarily deployed to Preview – sui-wallet-kit May 16, 2023 19:22 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-adapter May 16, 2023 19:22 Inactive
@vercel vercel bot temporarily deployed to Preview – explorer-storybook May 16, 2023 19:23 Inactive
@wlmyng wlmyng merged commit c3d9cc8 into main May 16, 2023
@wlmyng wlmyng deleted the better-error-handling-3 branch May 16, 2023 19:56
ronny-mysten pushed a commit that referenced this pull request May 17, 2023
## Description 

Replace anyhow errors with Error enum on sui-json-rpc where possible

## Test Plan 

How did you test the new or updated feature?

---
If your changes are not user-facing and not a breaking change, you can
skip the following section. Otherwise, please indicate what changed, and
then add to the Release Notes section as highlighted during the release
process.

### Type of Change (Check all that apply)

- [x] user-visible impact
- [ ] breaking change for a client SDKs
- [ ] breaking change for FNs (FN binary must upgrade)
- [ ] breaking change for validators or node operators (must upgrade
binaries)
- [ ] breaking change for on-chain data layout
- [ ] necessitate either a data wipe or data migration

### Release notes
[API behavioral changes] - rpc methods that result in errors of variant
`UserInputError`, `SuiRpcInputError`, `SuiError::TransactionNotFound` or
`SuiError::TransactionsNotFound` now return error code `-32602` instead
of `-32000`.
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.

2 participants