Skip to content

Errors

The SDKs raise a small set of error types, so you can branch on the type rather than parse a message. All of them extend AuraError, so one catch covers everything.

Type Means Carries
AuraApiError The API rejected the call status, detail
AuraConnectionError Nothing answered — the request never reached a server (TypeScript only) url, code
AuraResponseError The server answered, but with something the SDK could not read status — always in Python, when known in TypeScript
AuraTurnCancelledError The turn stopped before finishing the partial content, the conversation id
AuraTurnTimeoutError Your wait elapsed — the turn is still running the project id, the conversation id, the elapsed wait, the partial

Any non-2xx response. status is the HTTP code; detail is the API’s error body, which is a string for simple errors, an object for structured ones, and a list for a 422 validation error — check before assuming a shape.

import { AuraApiError } from "@strangeworks-inc/strangeworks-aura-sdk";
try {
await aura.getProject(projectId);
} catch (err) {
if (err instanceof AuraApiError) {
if (err.status === 401) throw new Error("key missing or revoked");
if (err.status === 404) return null; // no such project
if (err.status === 429) return retryLater(); // rate limited
}
throw err;
}

AuraConnectionError means the request never reached a server at all — connection refused, a DNS miss, a TLS failure. url is the address that was tried and code is the OS-level reason (ECONNREFUSED, ENOTFOUND, …) when the runtime exposes one.

The url is the request’s own target, not the client’s base URL: a byte upload goes to a storage host the base URL does not name, and that host is the one worth reporting.

import { AuraConnectionError } from "@strangeworks-inc/strangeworks-aura-sdk";
try {
await aura.listProjects();
} catch (err) {
if (err instanceof AuraConnectionError) {
throw new Error(`Aura is unreachable at ${err.url} (${err.code ?? "no code"})`);
}
throw err;
}

AuraResponseError means the call reached Aura and came back, but the body was not what the contract promises — an empty body where one was required, or a payload that is not the JSON it claimed. It is distinct from AuraApiError, which is the API deliberately rejecting you.

In TypeScript status is set only when it is known, so check it rather than assume; in Python it always is.

Raised when the server marked the reply partial: the turn was cancelled — by you, by another caller, or in TypeScript by aborting the signal — or died before finishing. Whatever the agent produced is attached. In Python, cancelling the task that awaits chat() raises asyncio.CancelledError instead, and leaves the turn running.

import { AuraTurnCancelledError } from "@strangeworks-inc/strangeworks-aura-sdk";
try {
const reply = await aura.chat(project.id, "Solve this.", { signal });
return reply.content;
} catch (err) {
if (err instanceof AuraTurnCancelledError) {
return err.partialContent ?? "(the agent stopped before writing anything)";
}
throw err;
}
import { AuraTurnTimeoutError } from "@strangeworks-inc/strangeworks-aura-sdk";
try {
return await aura.chat(project.id, "Solve this.", { timeoutMs: 10 * 60_000 });
} catch (err) {
if (err instanceof AuraTurnTimeoutError) {
console.warn(`still running after ${String(err.timeoutMs)}ms`);
await aura.cancel(project.id, err.conversationId); // or keep polling instead
}
throw err;
}

The elapsed wait is in milliseconds in TypeScript (timeoutMs) and seconds in Python (timeout).

import { AuraError } from "@strangeworks-inc/strangeworks-aura-sdk";
try {
await runPipeline();
} catch (err) {
if (err instanceof AuraError) {
console.error(`Aura: ${err.name}: ${err.message}`);
}
throw err;
}

Anything you are expected to hit prints as a plain message and exits 1 — a rejected request, an unreachable host, a mistyped flag, a missing setting. No stack traces. Each says what happened on the first line, and how to fix it on the second where the CLI knows:

$ aura project list
error Could not reach http://localhost:3000 (ECONNREFUSED)
Check that the server is running and that AURA_BASE_URL (or --base-url) points at it.
$ aura project list
error 401 Invalid API key
Check AURA_API_KEY (or --api-key). A key is per company and per region — mint one under
Settings → API Keys in the app for the region you are targeting.
That request went to https://aura-api-eu.strangeworks.com (the default region).
Use --region (eu or us), or --base-url, to target a different one.
$ aura conversation list --project 00000000-0000-0000-0000-000000000000
error 404 Project not found
Check the id. The matching "aura <noun> list" command shows what exists.

The first line is the API’s own detail — the same string the SDKs put on AuraApiError.detail. Where that already names its remedy (a 409 reads “a turn is in flight on this project — wait for it to finish, then retry”), the CLI adds nothing under it.

Cancelling a turn with Ctrl-C during aura chat --message stops the turn server-side and exits 130.

A stack trace means something else: the CLI hit a case it does not recognise, which is a bug worth reporting. It says so, and the trace is what to include.