error-handling
✓FastAPI、Pydantic 和 asyncio 的 Python 错误处理模式。遵循“让它崩溃”的理念 - 引发异常,捕获边界。涵盖 HTTPException、全局异常处理程序、验证错误、后台任务失败。在以下情况下使用:(1) 设计 API 错误响应,(2) 处理 RequestValidationError,(3) 管理异步异常,(4) 防止堆栈跟踪泄漏,(5) 设计自定义异常层次结构。
SKILL.md
Production-ready error handling for Python APIs using the Let it crash philosophy.
Let it crash - Don't be defensive. Let exceptions propagate naturally and handle them at boundaries.
| Need to retry | tenacity.retry() for transient failures | | Need to transform | Wrap third-party SDK errors as domain errors | | Need to clean up | Use finally or context managers | | Need to add context | raise DomainError(...) from original |
FastAPI、Pydantic 和 asyncio 的 Python 错误处理模式。遵循“让它崩溃”的理念 - 引发异常,捕获边界。涵盖 HTTPException、全局异常处理程序、验证错误、后台任务失败。在以下情况下使用:(1) 设计 API 错误响应,(2) 处理 RequestValidationError,(3) 管理异步异常,(4) 防止堆栈跟踪泄漏,(5) 设计自定义异常层次结构。 来源:jiatastic/open-python-skills。
可引用信息
为搜索与 AI 引用准备的稳定字段与命令。
- 安装命令
npx skills add https://github.com/jiatastic/open-python-skills --skill error-handling- 分类
- </>开发工具
- 认证
- ✓
- 收录时间
- 2026-02-01
- 更新时间
- 2026-02-18
快速解答
什么是 error-handling?
FastAPI、Pydantic 和 asyncio 的 Python 错误处理模式。遵循“让它崩溃”的理念 - 引发异常,捕获边界。涵盖 HTTPException、全局异常处理程序、验证错误、后台任务失败。在以下情况下使用:(1) 设计 API 错误响应,(2) 处理 RequestValidationError,(3) 管理异步异常,(4) 防止堆栈跟踪泄漏,(5) 设计自定义异常层次结构。 来源:jiatastic/open-python-skills。
如何安装 error-handling?
打开你的终端或命令行工具(如 Terminal、iTerm、Windows Terminal 等) 复制并运行以下命令:npx skills add https://github.com/jiatastic/open-python-skills --skill error-handling 安装完成后,技能将自动配置到你的 AI 编程环境中,可以在 Claude Code 或 Cursor 中使用
这个 Skill 的源码在哪?
https://github.com/jiatastic/open-python-skills
详情
- 分类
- </>开发工具
- 来源
- skills.sh
- 收录时间
- 2026-02-01