---
title: "Error handling and raw responses"
description: "Handle AdminApiError, cancellation, empty responses, and response metadata."
---

> Documentation Index
> Fetch the complete documentation index at: https://nexus.microvoid.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Error handling and raw responses

Generated methods throw `AdminApiError` for non-success HTTP responses.

```ts
import { AdminApiError } from '@nexus/sdk-typescript';

try {
  await nexus.getWorkspace({ path: { workspaceId } });
} catch (error) {
  if (error instanceof AdminApiError) {
    console.error(error.status, error.body);
  }
  throw error;
}
```

`AdminApiError` retains `status`, the Web Standard `Response`, and the parsed response body. JSON bodies are parsed only when Content-Type contains `json`; empty `204`/`205` responses become `undefined`.

## Raw response metadata

Use `requestRaw(operationId, input, options)` when the caller also needs headers or status:

```ts
const { data, response } = await nexus.requestRaw(
  'getWorkspace',
  { path: { workspaceId } },
  { signal: abortController.signal },
);
```

The SDK does not retry, reinterpret stable error codes, or hide cancellation. Pass an `AbortSignal` and make retry decisions at the application boundary.

Source: https://nexus.microvoid.io/management-sdk/error-handling/index.mdx
