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

CodeDescription
invalid_parameterA request parameter is invalid
missing_parameterA required parameter is missing
not_foundThe requested resource does not exist
unauthorizedInvalid or missing API key
rate_limitedToo many requests
internal_errorServer 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)
  }
}