vibz.art/docs

Error Handling

Error responses and exception hierarchy for the vibz.art API and SDKs.

HTTP error responses

All errors follow a consistent JSON format:

{
  "error": {
    "code": "INVALID_API_KEY",
    "message": "API key is invalid or inactive",
    "request_id": "req_a1b2c3d4e5f6"
  }
}

Error codes

HTTP StatusCodeDescription
401MISSING_API_KEYNo X-API-Key header provided
401INVALID_API_KEYKey is invalid or inactive
422VALIDATION_ERRORInvalid query parameters
429RATE_LIMIT_EXCEEDEDRate limit exceeded (check Retry-After header)
502COMPUTE_ERRORComputation service unavailable

SDK error handling

Python

from vibzart import Vibzart, AuthenticationError, RateLimitError, APIError

client = Vibzart(api_key="vz_live_...")

try:
    result = client.lilavati.panchang(lat=28.61, lng=77.20)
except AuthenticationError:
    # 401 — invalid or missing API key
    print("Check your API key")
except RateLimitError as e:
    # 429 — rate limit exceeded
    print(f"Rate limited. Retry after {e.retry_after}s")
except APIError as e:
    # Other API errors (422, 502, etc.)
    print(f"API error: [{e.status}] {e.code}: {e.detail}")

TypeScript

import { Vibzart, AuthenticationError, RateLimitError, APIError } from "@vibzart/sdk";

const client = new Vibzart({ apiKey: "vz_live_..." });

try {
  const result = await client.lilavati.panchang({ lat: 28.61, lng: 77.20 });
} catch (e) {
  if (e instanceof AuthenticationError) {
    console.error("Check your API key");
  } else if (e instanceof RateLimitError) {
    console.error(`Rate limited. Retry after ${e.retryAfter}s`);
  } else if (e instanceof APIError) {
    console.error(`API error: [${e.status}] ${e.code}: ${e.detail}`);
  }
}

Exception hierarchy

ExceptionHTTP StatusDescription
AuthenticationError401Missing or invalid API key
RateLimitError429Rate limit exceeded (has retry_after / retryAfter)
APIError4xx/5xxOther API errors
APIConnectionErrorNetwork timeout or connection failure

Retries

Both SDKs automatically retry requests that fail with 429, 500, 502, 503, or 504 using exponential backoff with jitter.

  • Default: 2 retries (3 total attempts)
  • Set max_retries=0 (Python) or maxRetries: 0 (TypeScript) to disable

Response metadata

Every successful response includes metadata alongside the data:

result = client.lilavati.panchang(lat=28.61, lng=77.20)

result.data          # Typed response object
result.cached        # True if served from cache
result.request_id    # Unique ID for debugging (e.g. "req_a1b2c3d4e5f6")
result.rate_limit    # RateLimitInfo(limit=100, remaining=99, reset=...)

Include the request_id when contacting support.