Skip to main content
The mobile package provides structured error handling with consistent response formats, error codes, and detailed context for mobile clients.

Quick Start

Response:

Error Codes

Standard error codes for mobile clients:

The Error Type

Creating Errors

Error Methods

Sending Errors

Basic Usage

With HTTP Status Codes

Common Patterns

Authentication Errors

Validation Errors

Response:

Not Found Errors

Rate Limiting Errors

Upgrade Required

Maintenance Mode

Error Response Format

All errors follow a consistent format:

Adding Trace IDs

Client Implementation

iOS (Swift)

Android (Kotlin)

Flutter (Dart)

Best Practices

Use Appropriate Status Codes

  • 400 - Client error (bad input)
  • 401 - Authentication required
  • 403 - Permission denied
  • 404 - Resource not found
  • 409 - Conflict (duplicate, etc.)
  • 422 - Validation error (alternative to 400)
  • 426 - Upgrade required
  • 429 - Rate limited
  • 500 - Server error
  • 503 - Maintenance

Be Specific in Error Messages

Include Actionable Information

Log Errors Server-Side

Next Steps

Pagination

Page and cursor-based pagination

Offline Sync

Delta synchronization

API Reference

Complete API documentation