exception-taxonomy

Define hierarchical API exceptions with HTTP status codes and machine-readable error codes.

783|62|Updated Jan 19, 2026
One-click install
npx skills add https://github.com/dadbodgeoff/drift --skill exception-taxonomy
Or copy as Structured Prompt for Agentโ–ผ
Please help me install this Agent Skill.
Skill: exception-taxonomy
Source: https://github.com/dadbodgeoff/drift/tree/main/drift%20v1%20depreciated/skills/exception-taxonomy
Command: npx skills add https://github.com/dadbodgeoff/drift --skill exception-taxonomy

SYSTEM DOCUMENTATION & REQUIREMENTS

๐Ÿ’ก This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill provides a robust and hierarchical system for managing API errors, ensuring consistent, machine-readable, and informative error responses across all endpoints.

Core Features & Use Cases

  • Consistent Error Responses: Define a standardized structure for all API errors.
  • Machine-Readable Codes: Use enumerated error codes for programmatic handling by clients.
  • HTTP Status Code Mapping: Associate specific HTTP status codes with different error types.
  • Retry Hints: Include retry_after information for transient errors like rate limiting.
  • Use Case: When a user attempts to access a resource they don't have permission for, the API consistently returns a 403 Forbidden status with a clear FORBIDDEN error code and a descriptive message, allowing the client to inform the user appropriately.

Quick Start

Implement the provided Python or TypeScript classes to raise structured exceptions for common API error scenarios.

Frequently Asked Questions about exception-taxonomy

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I standardize API error handling in Python and TypeScript?โ–ผ

You can standardize API error handling by implementing a hierarchical exception system that maps application-specific errors to HTTP status codes and machine-readable error codes for both Python and TypeScript.

What is the best way to map HTTP status codes to machine-readable API error codes?โ–ผ

Mapping HTTP status codes to machine-readable API errors is best handled by defining a hierarchical exception system that attaches specific enumerated error codes, such as FORBIDDEN, directly to corresponding HTTP statuses.

Does this API error handling approach support rate limiting and transient errors?โ–ผ

Yes, this API error handling approach supports transient errors by allowing you to define exceptions like RateLimitError, which can include structured retry_after hints in the response payload for clients.

How do I return consistent error responses for invalid state transitions in a REST API?โ–ผ

To return consistent error responses for invalid state transitions, raise a structured exception like InvalidStateTransitionError that outputs a standardized message and machine-readable code.

Can I use this hierarchical exception system for a REST API without external dependencies?โ–ผ

Yes, you can use this hierarchical exception system in a REST API without external dependencies, as it provides standalone Python and TypeScript implementations for defining and managing structured API errors.