Error Handling
How to handle errors from the Nevuto API.
The Nevuto API returns standard HTTP status codes and structured error responses.
Error Response Format
{
"error": {
"code": "invalid_parameter",
"message": "The 'price' field must be a positive integer.",
"param": "price"
}
}
Error Codes
| Code | Description |
|---|---|
invalid_parameter | A request parameter is invalid |
missing_parameter | A required parameter is missing |
not_found | The requested resource does not exist |
unauthorized | Invalid or missing API key |
rate_limited | Too many requests |
internal_error | Server error — contact support |
Handling Errors in Code
try {
const product = await client.products.create({ name: '' })
} catch (err) {
if (err.status === 400) {
console.log('Validation error:', err.message)
} else if (err.status === 429) {
// Wait and retry
await sleep(err.retryAfter * 1000)
}
}