Skip to main content
The Lomadee SDK does not wrap failures in a custom error taxonomy. When a request fails, the underlying Axios error propagates to your await—your application decides how to log, retry, and present the failure.

What can go wrong

The table below describes typical upstream HTTP behavior you may encounter. Status codes and error bodies are not normalized by the SDK and can vary by microservice—do not treat this as a guaranteed taxonomy. The SDK sets a 10 second timeout on the shared HTTP client. There is no built-in retry or circuit breaker—you implement resilience in your application layer if needed.

Basic handling pattern

Start with explicit try/catch around SDK calls. Log enough context for debugging (resource, method, correlation id) but never log headers or the authKey:
If you prefer Axios utilities such as isAxiosError, import them from the axios package in your application. The SDK lists Axios as its own dependency; applications that import Axios directly should declare axios as a direct dependency to avoid relying on transitive installs.

Map HTTP status to application behavior

Design handlers around intent, not around SDK internals:
Use status-aware branching in your API layer to return appropriate HTTP codes and messages to your callers. The SDK does not translate upstream bodies into a stable public error schema.

Retries and timeouts

Because the SDK does not retry automatically, you may add retries in application code. Apply these guardrails:
Do not retry write operations indiscriminately. Methods such as transactions.create, commissions.create, and affiliates.create may have side effects. Retrying without an idempotency strategy can duplicate data. Prefer retries for read calls (get, list, latest) when upstream returns a transient 5xx or a timeout.
Guidelines:
  • Reads (list, get, latest): up to a small number of retries with exponential backoff when you see 502/503/504 or a timeout
  • Creates / updates / deletes: fail visibly on the first error unless your integration design explicitly supports safe replay (confirm with Lomadee before implementing)
  • Auth errors (401/403): never retry—fix configuration
  • Client errors (4xx): fix input; do not retry the same payload
Example: bounded retry for a read-only terms check:

Observability without leaking secrets

  • Log HTTP status, the SDK method name (for example terms.latest), and your own trace ids
  • Avoid logging full Axios config.headers—they contain x-auth-key
  • Return generic messages to end users; keep detailed upstream bodies in server-side logs only

When errors persist

  1. Verify LOMADEE_AUTH_KEY and environment match what Lomadee provisioned (Environments and secrets)
  2. Re-run the Quickstart sdk.terms.latest() check in the same environment
  3. Contact Lomadee support with timestamps, environment, and the resource method—not your raw authKey