Skip to main content

Errors

Trailproof uses a structured error hierarchy. All errors extend TrailproofError.

Error Hierarchy

Error Message Format

All errors follow a consistent format:
Examples:
  • Trailproof: missing required field -- actor_id is required
  • Trailproof: store write failed -- permission denied
  • Trailproof: HMAC verification failed -- signature mismatch

ValidationError

Thrown by emit() when required fields are missing or empty.
Required fields that trigger ValidationError when missing or empty:
  • event_type / eventType
  • actor_id / actorId
  • tenant_id / tenantId
  • payload

StoreError

Thrown when the storage backend fails — for example, when the JSONL file can’t be written.
Python

ChainError

Represents a broken hash chain. Note that verify() does not throw this error — it returns a VerifyResult with intact: false. ChainError is available for application code that needs to raise chain-related errors.

SignatureError

Thrown when HMAC verification fails — for example, when an event has a signature field but no signing key is configured.
Python

Catching All Trailproof Errors

Use the base class to catch any Trailproof error: