> ## 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

> Legacy TypeScript SDK v0.6.0 docs for handling errors like ConfigurationError, ValidationError, RateLimitError, and TimeoutError in evaluators.

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({
    googleApiKey: process.env.GOOGLE_API_KEY,
  });
  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

> [card] [Quickstart](https://docs.learningcommons.org/evaluators/getting-started/quickstart.md#sdk)
>
> Install the SDK and run your first evaluator.

> [card] [Configuration](https://docs.learningcommons.org/evaluators/using-evaluators/typescript-sdk/past-versions/typescript-v0.6.0/configuration.md)
>
> Configure evaluators, including API keys and options.

> [card] [Outputs](https://docs.learningcommons.org/evaluators/using-evaluators/typescript-sdk/past-versions/typescript-v0.6.0/outputs.md)
>
> Understand evaluator output fields and types.

> [card] [Batch evaluator](https://docs.learningcommons.org/evaluators/using-evaluators/typescript-sdk/past-versions/typescript-v0.6.0/batch-evaluator.md)
>
> Evaluate a batch of text from a CSV file using Text Complexity evaluators.
