defensive-api-handling
Installation
SKILL.md
Defensive API Handling
Purpose: Safely handle API responses to prevent crashes
When to Use: Any time you call an API endpoint (in tests or production code)
Never Assume API Returns JSON
APIs can return:
- JSON (expected)
- HTML error pages
- Empty responses
- Malformed JSON
- Non-200 status codes
Your code must handle ALL of these safely.