> For the complete documentation index, see [llms.txt](https://docs.yield.fi/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.yield.fi/earn-with-yieldfi/integration-sdk/error-handling.md).

# Error Handling

## Overview

The YieldFi SDK provides specialized error classes for different error scenarios. All errors extend from `SDKError` and include detailed information.

### Error Types

* `SDKError` - Base error class
* `AuthenticationError` - Authentication failures
* `NetworkError` - Network and HTTP errors
* `ValidationError` - Input validation errors
* `ConfigurationError` - SDK configuration errors

### Quick Example

```typescript
import {
  AuthenticationError,
  NetworkError,
  ValidationError,
} from "yieldfi-sdk";

try {
  const vault = await sdk.vault.getVaultByKey("yusd", 1);
} catch (error) {
  if (error instanceof AuthenticationError) {
    console.error("Auth failed:", error.message);
  } else if (error instanceof NetworkError) {
    console.error("Network error:", error.statusCode);
  } else if (error instanceof ValidationError) {
    console.error("Validation error:", error.message);
  }
}
```

### Next Steps

* Error Types - Detailed error type reference
* Best Practices - Error handling best practices
