Reference

Errors

Tuerss uses conventional HTTP status codes to indicate success or failure. Codes in the 2xx range mean success, 4xx codes indicate a problem with your request, and 5xx codes indicate a problem on our servers. Every error response returns a structured JSON body.

Error shape

Each error includes a machine-readable type, a human message, and a request ID for support.

422 Unprocessable Entity
{
  "error": {
    "type": "validation_error",
    "code": 422,
    "message": "The field 'email' must be a valid email address.",
    "param": "email",
    "request_id": "req_9fK2mQ4xVt"
  }
}

Status codes

StatusTypeMeaning
400bad_requestThe request was malformed or missing required fields.
401unauthorizedNo valid API key was provided in the request.
403forbiddenThe API key does not have access to this resource.
404not_foundThe requested resource does not exist.
409conflictThe request conflicts with the current state.
422validation_errorOne or more fields failed validation.
429rate_limitedYou have exceeded your plan rate limit.
500internal_errorSomething went wrong on our end.
503service_unavailableThe service is temporarily offline.

Handling errors

Wrap calls in a try/catch. The SDK throws typed errors you can branch on.

error-handling.js
try {
  const res = await client.geocode.lookup({ address: "1 Infinite Loop" })
} catch (err) {
  if (err.code === 429) {
    // back off and retry after the Retry-After header
    await sleep(err.retryAfter * 1000)
  } else {
    console.error(err.type, err.message, err.requestId)
  }
}