Skip to main content
All SDK operations return values directly and throw typed CofheError objects on failure. This replaces the Result wrapper pattern used by cofhejs.

Catching errors

CofheError structure

Every CofheError has:
  • code — a CofheErrorCode enum value identifying the error type
  • message — a human-readable description of what went wrong
Use isCofheError(err) to check if a caught error is a CofheError.

Common error codes

Error handling patterns

Encryption errors

Decryption errors