agentsclimarketplace

Litestar exceptions

Skill litestar-org/litestar-skills/skills/litestar-exceptions

Opinionated first-party agent skills, plugins, subagents, slash commands, and MCP servers for the Litestar framework ecosystem — publishable to Claude Code, Gemini CLI, Codex CLI, Cursor, OpenCode, and VS Code/Copilot from a single repo.

Install
npx -y skills add litestar-org/litestar-skills --skill litestar-exceptions

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 13 stars13 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Auto-activate for exception_handlers, HTTPException, ApplicationError, NotFoundError, ValidationException, PermissionDeniedException, RFC 9457, or domain error mapping. Not for client-side errors.

SKILL.md

2.6 KB, as published. Nobody here has run it

Litestar Exceptions

Use this skill for domain exception hierarchies, handler registration, and HTTP error response shape.

Code Style Rules

  • Centralize domain-to-HTTP translation in exception handlers.
  • Keep route handlers free of repetitive try/except blocks.
  • Use domain exception classes when services need stable error contracts.
  • Keep validation errors aligned with DTO and OpenAPI behavior.
  • Use ProblemDetailsPlugin explicitly when the API contract requires RFC 9457. Native HTTPException responses are Litestar's JSON error envelope.

Quick Reference

<workflow>

Workflow

  1. Define a small domain exception hierarchy.
  2. Register handlers at app config.
  3. Raise domain exceptions from services or Litestar exceptions from framework boundaries.
  4. Test response status and payload shape.
</workflow> <guardrails>

Guardrails

  • Do not catch exceptions in every handler.
  • Do not leak database exception messages to API clients.
  • Do not return inconsistent error payloads from neighboring routes.
  • Do not replace Litestar validation behavior without a clear API reason.
  • Do not describe native HTTPException responses as Problem Details unless ProblemDetailsPlugin is configured for them.
</guardrails> <validation>

Validation Checkpoint

  • Exceptions have stable status mapping.
  • App-level handlers are registered.
  • Services do not return sentinel error values.
  • Tests cover representative failure responses.
</validation> <example>

Example

class ApplicationError(HTTPException):
    status_code = 500

class ConflictError(ApplicationError):
    status_code = 409
</example>

References Index

Official References

Shared Styleguide Baseline

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.