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

# Error Handling

> Handle structured errors

## Error Codes

```typescript theme={null}
const result = await agent.execute(service, input);

if (!result.success) {
  switch (result.error?.code) {
    case "SERVICE_NOT_FOUND":
      console.log("Service not found");
      break;
    case "PAYMENT_FAILED":
      console.log("Payment failed");
      break;
  }
}
```
