Use errors to guide the user toward a next action. Do not expose raw internal wording when a clearer product state exists.

Common API categories

CategoryUser-facing response
Quote expiredAsk the user to refresh the quote and try again.
Quote already consumedFetch a new quote; never retry with the same one.
Amount mismatchRebuild the order from a fresh quote.
Duplicate commitmentGenerate a fresh secret and commitment hash.
Unsupported routeShow the pair as unavailable and let the user choose another route.
Watcher delayKeep polling and show the latest transaction hash.
Relayer acceptedShow pending; 202 Accepted does not mean mined.

Claim failures

Error shapeLikely causeNext step
Invalid secretSecret does not match the commitment hash.Regenerate flow from the saved swap secret, not a new random value.
Vault missingThe destination side has not been initiated yet.Keep polling or show solver delay.
Already settledThe side may already be claimed or cancelled.Refresh order state and chain status.
Hop signature invalidThe signed hop payload does not match the route.Rebuild from current order route data and re-sign.

Contract references

Contract-specific errors are listed on: