Help me implement proper error handling in my JavaScript/TypeScript application.
App type: [FRONTEND / BACKEND / FULL-STACK]
Framework: [REACT / NODE / EXPRESS / NEXT.JS / OTHER]
Current error handling: [MINIMAL / INCONSISTENT / WANT TO IMPROVE]
Provide:
1. **Error Types**: Custom error classes for different error categories
2. **Try-Catch Strategy**: When and how to use try-catch effectively
3. **Async Error Handling**: Handling errors in promises and async/await
4. **API Error Responses**: Consistent error response format
5. **Client-Side Errors**: Error boundaries and user-facing error messages
6. **Validation Errors**: Input validation and error formatting
7. **Logging Strategy**: What to log and at what level
8. **Global Error Handler**: Catching unhandled errors
9. **Retry Logic**: When and how to retry failed operations
10. **Error Monitoring**: Setting up error tracking (Sentry, etc.)
Help me implement proper error handling in my JavaScript/TypeScript application.
App type: [FRONTEND / BACKEND / FULL-STACK]
Framework: [REACT / NODE / EXPRESS / NEXT.JS / OTHER]
Current error handling: [MINIMAL / INCONSISTENT / WANT TO IMPROVE]
Provide:
1. **Error Types**: Custom error classes for different error categories
2. **Try-Catch Strategy**: When and how to use try-catch effectively
3. **Async Error Handling**: Handling errors in promises and async/await
4. **API Error Responses**: Consistent error response format
5. **Client-Side Errors**: Error boundaries and user-facing error messages
6. **Validation Errors**: Input validation and error formatting
7. **Logging Strategy**: What to log and at what level
8. **Global Error Handler**: Catching unhandled errors
9. **Retry Logic**: When and how to retry failed operations
10. **Error Monitoring**: Setting up error tracking (Sentry, etc.)
How to use this prompt
Copy the prompt above and paste it into ChatGPT, Claude, Gemini, or any AI assistant. Replace the bracketed placeholders with your specific details.
Leave a Review
Tried this prompt? Let us know how it worked — your reviews help other users find the best prompts.