GraphQL Error Format
SmartMenu API returns errors in the standard GraphQL format:Error Codes
Authentication Errors
| Code | HTTP Status | Description | User Action |
|---|---|---|---|
MISSING_HEADER | 400 | Required header not provided | Fix request headers |
INVALID_TOKEN | 401 | API key invalid or expired | Check API key configuration |
FORBIDDEN | 403 | Key lacks access to requested chain | Contact EveryBite |
Validation Errors
| Code | HTTP Status | Description | User Action |
|---|---|---|---|
INVALID_INPUT | 400 | Request parameter malformed | Check request format |
CHAIN_NOT_FOUND | 404 | Chain ID doesn’t exist | Verify chain ID |
DISH_NOT_FOUND | 404 | Dish ID doesn’t exist | Handle gracefully |
Rate Limiting
| Code | HTTP Status | Description | User Action |
|---|---|---|---|
RATE_LIMITED | 429 | Too many requests | Wait and retry |
Server Errors
| Code | HTTP Status | Description | User Action |
|---|---|---|---|
INTERNAL_ERROR | 500 | Server error | Retry or graceful fallback |
SERVICE_UNAVAILABLE | 503 | Service temporarily down | Retry with backoff |
Handling Errors in Code
Basic Error Handler
Error Classes
Centralized Error Handler
Graceful Degradation
When SmartMenu API is unavailable, your app should continue to function.Fallback Pattern
UI Fallback
Retry Logic
Exponential Backoff
Rate Limit Handling
User-Facing Error Messages
| Error Code | User Message |
|---|---|
RATE_LIMITED | ”Please wait a moment and try again” |
DISH_NOT_FOUND | ”This dish is no longer available” |
CHAIN_NOT_FOUND | ”Restaurant not found” |
INTERNAL_ERROR | ”Something went wrong. Please try again.” |
| Network Error | ”Unable to connect. Please check your internet connection.” |
Logging and Monitoring
Best Practices
Always Handle Errors
Never let errors bubble up to crash your app. Always catch and handle.
User-Friendly Messages
Don’t show technical error messages to users. Translate to helpful guidance.
Fail Gracefully
If nutrition isn’t available, the dish should still be orderable.
Log for Debugging
Log errors with context for debugging, but don’t expose details to users.

