Creators to follow

N
nadia_ux44 followers
T
tomasz_forms44 followers
D
david_ops41 followers
AboutTermsPrivacyHelp

© 2026 teliprompt

RA
ravi_api
8 months ago•
Backend

API error handling system with typed errors and client SDK

Claude Sonnet 4.6
code output
#error-handling
#api-design
#nestjs
#typescript
#sdk
Views
9.3K
Copies
3.1K
Likes
1.1K
Comments
0
Copy rate
33.0%

Prompt

Design and implement a comprehensive error handling system for a [framework] REST API that includes:

1. A typed error hierarchy (base error class + specific errors)
2. Global exception filter that formats errors consistently
3. Error codes enum for client consumption
4. Request ID tracking for debugging
5. Error logging with context (user, route, stack trace)
6. Client-friendly error responses (no internal details leaked)
7. Validation error formatting (field-level errors)
8. A TypeScript client helper for [client_framework] that parses these errors

The error response format should be:
```json
{ "error": { "code": "RESOURCE_NOT_FOUND", "message": "...", "requestId": "...", "details": [] } }
```

Customise this prompt

Fill in 2 variables to personalise this prompt

Preview
Design and implement a comprehensive error handling system for a [framework] REST API that includes: 1. A typed error hierarchy (base error class + specific errors) 2. Global exception filter that formats errors consistently 3. Error codes enum for client consumption 4. Request ID tracking for debugging 5. Error logging with context (user, route, stack trace) 6. Client-friendly error responses (no internal details leaked) 7. Validation error formatting (field-level errors) 8. A TypeScript client helper for [client_framework] that parses these errors The error response format should be: ```json { "error": { "code": "RESOURCE_NOT_FOUND", "message": "...", "requestId": "...", "details": [] } } ```

Example output

Related prompts

Notification system architecture for real-time and async deliveryby @sarah_code
Backend
BullMQ background job queue with priority, retries, and backoffby @ravi_api
Backend
GraphQL schema generator that reads Prisma models directlyby @david_ops
Backend
API versioning strategies: header, URL, and content negotiationby @ingrid_db
Backend