Skip to content

Write the Errors Reference #460

Description

@codebestia

Each contract crate defines its own error enum. Produce a single reference mapping every error to its numeric code, the condition that raises it, and the corrective action — the page a developer lands on after a failed transaction.

Proposed steps:

  • Create docs/reference/errors.md.
  • Document every variant in contracts/shade/src/errors.rs with its discriminant, the functions that can raise it, the exact triggering condition, and how to fix it.
  • Do the same for account, escrow, escrow_factory, ticketing, ticketing_factory, and subscription, in clearly separated sections, noting that codes are only unique within a contract.
  • Explain how a Soroban error surfaces in CLI output and in SDK client errors, with an example of reading the code from a failed transaction.
  • Add a troubleshooting table for the most frequently hit errors, mapping symptom → likely cause → fix.
  • Document the convention for adding a new error variant (append only; never renumber) and link it to the upgradeability rules.

Acceptance criteria:

  • docs/reference/errors.md exists and covers every error enum in the workspace.
  • Each variant lists its code, trigger, and remedy.
  • An example of extracting an error code from a failed transaction is included.
  • The append-only numbering convention is documented.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions