Skip to main content

Hierarchy

Every SDK exception extends ParmanaError (typescript/src/errors/ParmanaError.ts), which carries a stable code: ErrorCode, a message, and optional requestId / cause:
enum ErrorCode {
  CONFIGURATION_ERROR = "CONFIGURATION_ERROR",
  VALIDATION_ERROR = "VALIDATION_ERROR",
  AUTHENTICATION_ERROR = "AUTHENTICATION_ERROR",
  AUTHORIZATION_ERROR = "AUTHORIZATION_ERROR",
  EXECUTION_REJECTED = "EXECUTION_REJECTED",
  VERIFICATION_ERROR = "VERIFICATION_ERROR",
  REPLAY_ERROR = "REPLAY_ERROR",
  NETWORK_ERROR = "NETWORK_ERROR",
  TIMEOUT_ERROR = "TIMEOUT_ERROR",
  INTERNAL_SERVER_ERROR = "INTERNAL_SERVER_ERROR",
}
ClasscodeFile
ConfigurationErrorCONFIGURATION_ERRORerrors/ConfigurationError.ts
ValidationErrorVALIDATION_ERRORerrors/ValidationError.ts
AuthenticationErrorAUTHENTICATION_ERRORerrors/AuthenticationError.ts
AuthorizationErrorAUTHORIZATION_ERRORerrors/AuthorizationError.ts
ExecutionRejectedErrorEXECUTION_REJECTEDerrors/ExecutionRejectedError.ts
VerificationErrorVERIFICATION_ERRORerrors/VerificationError.ts
ReplayErrorREPLAY_ERRORerrors/ReplayError.ts
NetworkErrorNETWORK_ERRORerrors/NetworkError.ts
TimeoutErrorTIMEOUT_ERRORerrors/TimeoutError.ts
InternalServerErrorINTERNAL_SERVER_ERRORerrors/InternalServerError.ts
Most of these are never thrown by the SDK. Searching typescript/src for throw new finds exactly three sites:
  • ParmanaClient’s constructor throws ConfigurationError when endpoint or transport is missing.
  • HttpTransport.send throws TimeoutError when the AbortController fires.
  • HttpTransport.send throws NetworkError for any other fetch rejection.
ValidationError, AuthenticationError, AuthorizationError, ExecutionRejectedError, VerificationError, ReplayError, and InternalServerError are fully defined, exported, and documented — but nothing in HttpTransport or any *Api class inspects response.status and throws them. HttpTransport.send resolves successfully for any HTTP status, including 4xx and 5xx: it only special-cases 204 (empty body) and otherwise always calls response.json() and returns a TransportResponse.In practice, if the server returns { "error": "Execution Trust Record not found." } with a 404, client.replay(id) resolves with that error object typed as ReplayResult — it does not throw. Check response-shaped data defensively, or inspect status via a custom Transport, rather than relying on a catch block for anything other than ConfigurationError, TimeoutError, or NetworkError.

Catching errors

import { ParmanaError, TimeoutError, NetworkError, ConfigurationError } from "parmana";

try {
  const client = new ParmanaClient(configuration);
  const trustRecord = await client.execute(transaction);
} catch (error) {
  if (error instanceof TimeoutError) {
    // request exceeded configuration.timeout
  } else if (error instanceof NetworkError) {
    // fetch rejected (DNS, connection refused, etc.)
  } else if (error instanceof ConfigurationError) {
    // missing endpoint or transport
  } else if (error instanceof ParmanaError) {
    // any other SDK-defined error (currently unreachable in practice)
  } else {
    throw error;
  }
}

Error Model (REST API)

The server-side error shape these responses actually carry.

Installation

Timeout and transport configuration.

Python SDK — errors

Whether the Python client has the same gap.