> ## Documentation Index
> Fetch the complete documentation index at: https://docs.argalabs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# TypeScript error handling

> Handle API errors from the TypeScript SDK

```typescript theme={null}
import { Arga, ArgaAPIError } from 'arga-sdk';

const client = new Arga({ apiKey: 'arga_sk_...' });

try {
  await client.runs.get('nonexistent');
} catch (err) {
  if (err instanceof ArgaAPIError) {
    console.error(err.statusCode); // 404
    console.error(err.message);    // "Not found"
  }
}
```
