← Back to Home
FMP Tools Documentation
Error Handling
Comprehensive guide to error handling in FMP Tools.
Overview
FMP Tools provide consistent error handling across all tools. When something goes wrong, you'll get clear, actionable error messages.
How Errors Work
All tools return a standardized response format:
Common Error Scenarios
API Key Issues
- "API key not found" - Ensure
FMP_API_KEY
is set in your environment - "Invalid API key" - Check that your API key is correct and active
Data Issues
- "Symbol not found" - The stock/ETF symbol doesn't exist or is invalid
- "No data available" - The requested data isn't available for this symbol/date
Rate Limiting
- "Rate limit exceeded" - You've hit the API rate limit
- "Too many requests" - Slow down your requests
Network Issues
- "Network error" - Connection problems
- "Timeout" - Request took too long
Error Handling in Vercel AI SDK
Basic Error Handling
app/api/chat/route.ts
Advanced Error Handling
app/api/chat/route.ts
React Error Boundaries
Error Boundary Component
Using Error Boundaries
User-Facing Error Handling
Loading and Error States
Debugging Tips
Enable Debug Mode
app/api/chat/route.ts
Check Environment Variables
Best Practices
- Always implement error boundaries in React applications
- Log errors for debugging and monitoring
- Provide user-friendly error messages instead of technical details
- Handle loading states to improve user experience
- Implement retry logic for transient errors
- Monitor error rates in production
Next Steps
- Best Practices - Learn more about building robust applications
- Examples - See error handling in action
- Vercel AI SDK Integration - Learn about the integration
Getting Started
Tool Reference
Advanced
Error Handling
Comprehensive guide to error handling in FMP Tools.
Overview
FMP Tools provide consistent error handling across all tools. When something goes wrong, you'll get clear, actionable error messages.
How Errors Work
All tools return a standardized response format:
Common Error Scenarios
API Key Issues
- "API key not found" - Ensure
FMP_API_KEY
is set in your environment - "Invalid API key" - Check that your API key is correct and active
Data Issues
- "Symbol not found" - The stock/ETF symbol doesn't exist or is invalid
- "No data available" - The requested data isn't available for this symbol/date
Rate Limiting
- "Rate limit exceeded" - You've hit the API rate limit
- "Too many requests" - Slow down your requests
Network Issues
- "Network error" - Connection problems
- "Timeout" - Request took too long
Error Handling in Vercel AI SDK
Basic Error Handling
app/api/chat/route.ts
Advanced Error Handling
app/api/chat/route.ts
React Error Boundaries
Error Boundary Component
Using Error Boundaries
User-Facing Error Handling
Loading and Error States
Debugging Tips
Enable Debug Mode
app/api/chat/route.ts
Check Environment Variables
Best Practices
- Always implement error boundaries in React applications
- Log errors for debugging and monitoring
- Provide user-friendly error messages instead of technical details
- Handle loading states to improve user experience
- Implement retry logic for transient errors
- Monitor error rates in production
Next Steps
- Best Practices - Learn more about building robust applications
- Examples - See error handling in action
- Vercel AI SDK Integration - Learn about the integration