{"id":"ae2e59bd-c90b-4408-bb16-69f772ad3ac1","shortId":"YVP86z","kind":"skill","title":"litestar-exceptions","tagline":"Auto-activate for exception_handlers, HTTPException, ApplicationError, NotFoundError, ConflictError, ValidationException, PermissionDeniedException, RFC 7807 responses, or domain-to-HTTP error mapping. Use when designing Litestar exception hierarchies, handlers, or error response","description":"# Litestar Exceptions\n\nUse this skill for domain exception hierarchies, handler registration, and HTTP error response shape.\n\n## Code Style Rules\n\n- Centralize domain-to-HTTP translation in exception handlers.\n- Keep route handlers free of repetitive try/except blocks.\n- Use domain exception classes when services need stable error contracts.\n- Keep validation errors aligned with DTO and OpenAPI behavior.\n\n## Quick Reference\n\n- Exception patterns: [exceptions.md](references/exceptions.md)\n- Pair with [litestar-auth-guards](../litestar-auth-guards/SKILL.md) for permission failures.\n- Pair with [litestar-data-services](../litestar-data-services/SKILL.md) for not-found and conflict behavior.\n\n<workflow>\n\n## Workflow\n\n1. Define a small domain exception hierarchy.\n2. Register handlers at app config.\n3. Raise domain exceptions from services or Litestar exceptions from framework boundaries.\n4. Test response status and payload shape.\n\n</workflow>\n\n<guardrails>\n\n## Guardrails\n\n- Do not catch exceptions in every handler.\n- Do not leak database exception messages to API clients.\n- Do not return inconsistent error payloads from neighboring routes.\n- Do not replace Litestar validation behavior without a clear API reason.\n\n</guardrails>\n\n<validation>\n\n## Validation Checkpoint\n\n- [ ] Exceptions have stable status mapping.\n- [ ] App-level handlers are registered.\n- [ ] Services do not return sentinel error values.\n- [ ] Tests cover representative failure responses.\n\n</validation>\n\n<example>\n\n## Example\n\n```python\nclass ApplicationError(HTTPException):\n    status_code = 500\n\nclass ConflictError(ApplicationError):\n    status_code = 409\n```\n\n</example>\n\n## References Index\n\n- [exceptions.md](references/exceptions.md)\n\n## Official References\n\n- <https://docs.litestar.dev/> - Litestar documentation\n- <https://docs.litestar.dev/latest/reference/> - Litestar API reference\n\n## Shared Styleguide Baseline\n\n- [General](../litestar-styleguide/references/general.md)\n- [Python](../litestar-styleguide/references/python.md)\n- [Litestar](../litestar-styleguide/references/litestar.md)","tags":["litestar","exceptions","skills","litestar-org","advanced-alchemy","agent-skills","agentskills","ai-agents","claude-code-plugin","claude-code-skills","gemini-cli-extension","htmx"],"capabilities":["skill","source-litestar-org","skill-litestar-exceptions","topic-advanced-alchemy","topic-agent-skills","topic-agentskills","topic-ai-agents","topic-claude-code-plugin","topic-claude-code-skills","topic-gemini-cli-extension","topic-htmx","topic-inertia","topic-litestar","topic-mcp","topic-python"],"categories":["litestar-skills"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/litestar-org/litestar-skills/litestar-exceptions","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add litestar-org/litestar-skills","source_repo":"https://github.com/litestar-org/litestar-skills","install_from":"skills.sh"}},"qualityScore":"0.453","qualityRationale":"deterministic score 0.45 from registry signals: · indexed on github topic:agent-skills · 7 github stars · SKILL.md body (2,086 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-05-18T19:13:53.876Z","embedding":null,"createdAt":"2026-05-18T13:20:57.306Z","updatedAt":"2026-05-18T19:13:53.876Z","lastSeenAt":"2026-05-18T19:13:53.876Z","tsv":"'/latest/reference/':241 '/litestar-auth-guards/skill.md':103 '/litestar-data-services/skill.md':113 '/litestar-styleguide/references/general.md':249 '/litestar-styleguide/references/litestar.md':253 '/litestar-styleguide/references/python.md':251 '1':122 '2':129 '3':135 '4':147 '409':229 '500':223 '7807':17 'activ':6 'align':85 'api':169,189,243 'app':133,199 'app-level':198 'applicationerror':11,219,226 'auth':101 'auto':5 'auto-activ':4 'baselin':247 'behavior':90,120,185 'block':71 'boundari':146 'catch':157 'central':55 'checkpoint':192 'class':75,218,224 'clear':188 'client':170 'code':52,222,228 'config':134 'conflict':119 'conflicterror':13,225 'contract':81 'cover':212 'data':111 'databas':165 'defin':123 'design':28 'docs.litestar.dev':236,240 'docs.litestar.dev/latest/reference/':239 'document':238 'domain':21,42,57,73,126,137 'domain-to-http':20,56 'dto':87 'error':24,34,49,80,84,175,209 'everi':160 'exampl':216 'except':3,8,30,37,43,62,74,93,127,138,143,158,166,193 'exceptions.md':95,232 'failur':106,214 'found':117 'framework':145 'free':67 'general':248 'guard':102 'guardrail':154 'handler':9,32,45,63,66,131,161,201 'hierarchi':31,44,128 'http':23,48,59 'httpexcept':10,220 'inconsist':174 'index':231 'keep':64,82 'leak':164 'level':200 'litestar':2,29,36,100,110,142,183,237,242,252 'litestar-auth-guard':99 'litestar-data-servic':109 'litestar-except':1 'map':25,197 'messag':167 'need':78 'neighbor':178 'not-found':115 'notfounderror':12 'offici':234 'openapi':89 'pair':97,107 'pattern':94 'payload':152,176 'permiss':105 'permissiondeniedexcept':15 'python':217,250 'quick':91 'rais':136 'reason':190 'refer':92,230,235,244 'references/exceptions.md':96,233 'regist':130,203 'registr':46 'repetit':69 'replac':182 'repres':213 'respons':18,35,50,149,215 'return':173,207 'rfc':16 'rout':65,179 'rule':54 'sentinel':208 'servic':77,112,140,204 'shape':51,153 'share':245 'skill':40 'skill-litestar-exceptions' 'small':125 'source-litestar-org' 'stabl':79,195 'status':150,196,221,227 'style':53 'styleguid':246 'test':148,211 'topic-advanced-alchemy' 'topic-agent-skills' 'topic-agentskills' 'topic-ai-agents' 'topic-claude-code-plugin' 'topic-claude-code-skills' 'topic-gemini-cli-extension' 'topic-htmx' 'topic-inertia' 'topic-litestar' 'topic-mcp' 'topic-python' 'translat':60 'try/except':70 'use':26,38,72 'valid':83,184,191 'validationexcept':14 'valu':210 'without':186 'workflow':121","prices":[{"id":"491cf133-c7ad-457e-80a9-519acc5fb557","listingId":"ae2e59bd-c90b-4408-bb16-69f772ad3ac1","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"litestar-org","category":"litestar-skills","install_from":"skills.sh"},"createdAt":"2026-05-18T13:20:57.306Z"}],"sources":[{"listingId":"ae2e59bd-c90b-4408-bb16-69f772ad3ac1","source":"github","sourceId":"litestar-org/litestar-skills/litestar-exceptions","sourceUrl":"https://github.com/litestar-org/litestar-skills/tree/main/skills/litestar-exceptions","isPrimary":false,"firstSeenAt":"2026-05-18T13:20:57.306Z","lastSeenAt":"2026-05-18T19:13:53.876Z"}],"details":{"listingId":"ae2e59bd-c90b-4408-bb16-69f772ad3ac1","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"litestar-org","slug":"litestar-exceptions","github":{"repo":"litestar-org/litestar-skills","stars":7,"topics":["advanced-alchemy","agent-skills","agentskills","ai-agents","claude-code-plugin","claude-code-skills","gemini-cli-extension","htmx","inertia","litestar","mcp","python","sqlspec"],"license":"mit","html_url":"https://github.com/litestar-org/litestar-skills","pushed_at":"2026-05-13T16:04:09Z","description":"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.","skill_md_sha":"9a827d3a87c6be55a295401293f6be763a3acb48","skill_md_path":"skills/litestar-exceptions/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/litestar-org/litestar-skills/tree/main/skills/litestar-exceptions"},"layout":"multi","source":"github","category":"litestar-skills","frontmatter":{"name":"litestar-exceptions","description":"Auto-activate for exception_handlers, HTTPException, ApplicationError, NotFoundError, ConflictError, ValidationException, PermissionDeniedException, RFC 7807 responses, or domain-to-HTTP error mapping. Use when designing Litestar exception hierarchies, handlers, or error responses. Not for client-side errors or generic Python exception cleanup."},"skills_sh_url":"https://skills.sh/litestar-org/litestar-skills/litestar-exceptions"},"updatedAt":"2026-05-18T19:13:53.876Z"}}