Quick Start
How It Works
| Exception | Purpose | HTTP Status |
|---|---|---|
NotFoundError | Resource not found | 404 |
DuplicateError | Resource already exists | 409 |
AuthenticationError | Invalid credentials | 401 |
AuthorizationError | Insufficient permissions | 403 |
ValidationError | Invalid input data | 422 |
Exception Types
Base Exception
ThePlatformError base class provides common functionality:
Resource Errors
Handle resource-related errors with specific exceptions:Authentication & Authorization
Secure your platform with auth-specific exceptions:Data Validation
Validate input with clear error messages:FastAPI Integration
Handle platform exceptions in FastAPI applications:- Exception Handlers
- Service Usage
Common Patterns
Service Layer Pattern
Use exceptions consistently across services:Error Context
Include helpful context in exception messages:Exception Chaining
Chain exceptions to preserve original error context:Best Practices
Use Specific Exceptions
Use Specific Exceptions
Always use the most specific exception type available. This helps with error handling and debugging.
Include Helpful Messages
Include Helpful Messages
Provide clear, actionable error messages that help users understand what went wrong.
Consistent HTTP Mapping
Consistent HTTP Mapping
Each exception type maps to a specific HTTP status code. Use consistent exception handlers in your FastAPI applications.
Exception Hierarchy
Exception Hierarchy
Take advantage of the exception hierarchy. Catch
PlatformError to handle all platform exceptions, or catch specific types for targeted handling.Related
Platform Dependencies
Manage platform service dependencies
API Error Handling
Best practices for API error handling

