Skip to main content
Trading operations may throw PerpsError with numeric error codes. Use PerpsErrorCode for type-safe handling:

SDK-originated messages

PerpsErrorMessage pairs canonical human-readable text with PerpsErrors the SDK itself raises (not the backend’s error responses): AgentNotFound (agent-signing setup incomplete) and AgentStorageCorrupt (a stored agent keypair is malformed and the agent must be revoked and re-approved).

Common Trading Errors

See Error Codes for the complete reference, including how errorCodeFromStatus resolves a code from an HTTP status.