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

# Error handling

> Handle TypeScript SDK errors like ConfigurationError, ValidationError, RateLimitError, and TimeoutError when running evaluators in your app.

The SDK provides specific error types to help you handle different scenarios.

```typescript example.ts theme={null}
import {
  GradeLevelAppropriatenessEvaluator,
  ConfigurationError
} from "@learning-commons/evaluators";

try {
  const evaluator = new GradeLevelAppropriatenessEvaluator(configOptions);
  const result = await evaluator.evaluate(text);
} catch (error) {
  if (error instanceof ConfigurationError) {
    console.error("Fix config:", error.message);
  } else  { ... }
}
```

## Errors

| Type                  | Description                                         |
| --------------------- | --------------------------------------------------- |
| `ConfigurationError`  | Missing or invalid API keys                         |
| `ValidationError`     | Invalid input (text too short, invalid grade, etc.) |
| `AuthenticationError` | Invalid API keys                                    |
| `RateLimitError`      | Rate limit exceeded; wait and retry                 |
| `NetworkError`        | Network connectivity issues                         |
| `TimeoutError`        | Request timed out                                   |
| `APIError`            | Other API errors                                    |

## Related topics

<CardGroup cols={2}>
  <Card title="Quickstart" icon="rocket" href="/evaluators/getting-started/quickstart#sdk">
    Install the SDK and run your first evaluator.
  </Card>

  <Card title="Configuration" icon="gear" href="/evaluators/sdk-api-reference/typescript/configuration">
    Configure evaluators, including API keys and options.
  </Card>

  <Card title="Outputs" icon="table" href="/evaluators/sdk-api-reference/typescript/outputs">
    Understand evaluator output fields and types.
  </Card>

  <Card title="Batch evaluator" icon="layer-group" href="/evaluators/sdk-api-reference/typescript/batch-evaluator">
    Evaluate a batch of text from a CSV file using literacy evaluators.
  </Card>
</CardGroup>
