defensive-api-handling
CommunityPrevent API errors from crashing your code.
Authorbradtaylorsf
Version1.0.0
Installs0
System Documentation
What problem does it solve?
This Skill prevents application crashes caused by unexpected API responses, such as malformed JSON, HTML error pages, or non-200 status codes.
Core Features & Use Cases
- Safe JSON Parsing: Robustly parses JSON responses, handling errors and incorrect content types.
- Fetch with Timeout: Implements timeouts for API requests to prevent indefinite hangs.
- Retry Logic: Automatically retries failed API requests with configurable delays.
- Type-Safe Responses: Ensures API responses conform to expected structures using type guards.
- Error Boundary: Wraps API calls in an error boundary to catch and log exceptions gracefully.
- Use Case: When integrating with a third-party API, use this Skill to ensure your application remains stable even if the API returns an error or unexpected data format.
Quick Start
Use the defensive-api-handling skill to safely call the '/api/users' endpoint.
Dependency Matrix
Required Modules
None requiredComponents
Standard package💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: defensive-api-handling Download link: https://github.com/bradtaylorsf/alphaagent-team/archive/main.zip#defensive-api-handling Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.