---
url: >-
  https://adk.nht.io/api/@nhtio/adk/batteries/llm/anthropic_messages/error_translation/functions/anthropicErrorHeaders.md
---

# Function: anthropicErrorHeaders()

```ts
function anthropicErrorHeaders(err: unknown): Headers | undefined;
```

Defined in: [src/batteries/llm/anthropic\_messages/error\_translation.ts:82](https://github.com/NHTIO/ADK/blob/v1.20261003.0/src/src/batteries/llm/anthropic_messages/error_translation.ts#L82)

The response headers of a real SDK HTTP error, or `undefined` for anything else.

## Parameters

| Parameter | Type      | Description       |
| --------- | --------- | ----------------- |
| `err`     | `unknown` | The thrown value. |

## Returns

`Headers` | `undefined`

The error's `Headers`, or `undefined` when it is not an SDK HTTP error.

## Remarks

The `Retry-After` header is read on the retry path (`adapter.ts` and `count_tokens.ts`), and BOTH
sites previously guarded with `isInstanceOf(err, 'APIError', APIError)` against the inlined copy —
so issue #46 silently disabled `Retry-After` honouring as well as retry classification. Exporting
the structural check here keeps ONE identity-free definition of "is this an SDK HTTP error" and
lets those callers stop importing `@anthropic-ai/sdk/core/error` (which is what inlined the second
class identity in the first place).
