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

# Errors

> Error envelope, JSON-RPC error codes, and business-validation failures.

HTTP status is 200 for every dispatched call. Distinguish outcomes by response shape.

## Error shape

```json theme={null}
{
  "jsonrpc": "2.0",
  "id": 1,
  "error": {
    "code": 500,
    "message": "<service error message>"
  }
}
```

The `message` is the real error string from the backend. The `code` distinguishes protocol errors from runtime failures:

| Code     | Meaning                                                             |
| -------- | ------------------------------------------------------------------- |
| `-32700` | Parse error (invalid JSON)                                          |
| `-32600` | Invalid request (no method specified)                               |
| `-32601` | Unknown or unavailable method                                       |
| `-32602` | Invalid params (named parameters required)                          |
| `-32603` | Internal JSON-RPC error (defined by the dispatcher, rarely emitted) |
| `500`    | Service or internal error                                           |
| `403`    | Authorization denied                                                |

These codes are part of the generated contract: `JsonRpcError.code` in the [OpenAPI reference](/api-reference/openapi.json) carries the same enum, regenerated from the backend facade XML (`./gradlew :runtime:component:darpan:generateApiContract`).

## Business validation

Facade business validation does not use the error object. It returns a success envelope with `result.ok: false` and the failures in `result.errors[]`. Treat `ok: false` as a failed call even though no `error` object is present.
