> For the complete documentation index, see [llms.txt](https://docs.zofinance.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.zofinance.io/building-on-zo/zo-sdk/error-handling.md).

# Error Handling

The SDK throws errors for invalid operations and network issues. Always wrap API calls in try-catch blocks:

```typescript
const zlpAPI = SDK.createZLPAPI(network, provider, apiEndpoint, connectionURL)

try {
  const marketInfo = await zlpAPI.getMarketInfo()
  const depositTx = await zlpAPI.deposit('usdc', ['coinId'], 1000000)
} catch (error) {
  console.error('SDK operation failed:', error)
  if (error.message.includes('Unsupported LP token')) {
    console.error('Invalid LP token type provided')
  }
}
```
