fastapi-error-handling

Community

Deliver consistent FastAPI error responses.

Authoramaozhao
Version1.0.0
Installs0

System Documentation

What problem does it solve?

Centralizes error handling for FastAPI to ensure consistent error responses and easier maintenance.

Core Features & Use Cases

  • Centralized exception types (BusinessException, validation errors, database errors) with uniform JSON structure.
  • Distinguishes 4xx client errors from 5xx server errors while masking sensitive details.
  • Useful for APIs with multiple error types and business logic exceptions across many endpoints.
  • Use cases include rich error metadata, structured error codes, and easy integration with logging.

Quick Start

  • Install FastAPI-aware exception handling in your main app and register handlers.
  • Define custom exception classes and their handlers, and apply them across routers.
  • Example usage: raise BusinessException(...) and rely on handlers to format responses.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: fastapi-error-handling
Download link: https://github.com/amaozhao/MySkills/archive/main.zip#fastapi-error-handling

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.