-
Notifications
You must be signed in to change notification settings - Fork 109
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Motivation
When we forget to add an error message to packages/errors/src/messages.ts
, or when a server delivers an unexpected custom code, we fatal in the message printer (in development mode only).
kit/packages/errors/src/message-formatter.ts
Lines 21 to 24 in c6f3f2b
const messageFormatString = SolanaErrorMessages[code]; | |
if (messageFormatString.length === 0) { | |
return ''; | |
} |
See this PR for an example of when the server acquired error codes that we were late adding to the client: #658.
Details
The solution should:
- have minimal impact on bundle size
- give the developer enough information to recover from the actual error
- give the developer further information on what to do to have the actual error message materialize on the console and in the
npx @solana/errors decode
CLI. This means directing them to either update to the latest version of Kit, or to submit a pull request if the error code is missing in the latest version
gcangussu and lorisleiva
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request