---
description: Error handling -- ExecutionError vs PlatformToolError, retry logic, no auto-retry
paths:
  - operations/**
---
<!-- @generated by packages/sdk/scripts/copy-reference-docs.mjs -- DO NOT EDIT -->
<!-- Regenerate: pnpm scaffold:sync -->


# Error Handling

## Error Types

Two error classes from `@elevasis/sdk`:

**`ExecutionError`** -- base class for workflow/step failures.

```typescript
import { ExecutionError } from '@elevasis/sdk'

throw new ExecutionError('Payment processing failed', {
  context: { invoiceId: '123', amount: 500 }
})
```

**`PlatformToolError`** -- thrown by `platform.call()` and typed adapters.

```typescript
import { PlatformToolError } from '@elevasis/sdk'

try {
  await attio.createRecord({ ... })
} catch (err) {
  if (err instanceof PlatformToolError && err.retryable) {
    // Transient error (rate limit, timeout, network) -- safe to retry
  } else {
    // Permanent error (invalid credentials, bad input) -- don't retry
  }
}
```

## No Auto-Retry

The platform does NOT automatically retry failed steps. Your handler is responsible for retry logic. Check `PlatformToolError.retryable` to decide whether retrying is safe.

## Error Visibility

- Unhandled exceptions in handlers surface directly to CLI output and AI Studio.
- Use `context.logger.error()` to log errors -- `console.error()` is NOT captured by the platform.
- Write clear, descriptive error messages -- they're the primary debugging signal for end users.

## Common PlatformToolError Codes

| Code                  | Retryable | Cause                             |
| --------------------- | --------- | --------------------------------- |
| `rate_limit_exceeded` | Yes       | Integration API rate limit hit    |
| `timeout_error`       | Yes       | Integration call timed out        |
| `credentials_invalid` | No        | Credential not found or expired   |
| `validation_error`    | No        | Invalid parameters passed to tool |
