---
title: "ClikaRT::Error"
sidebar_label: "Error"
description: "Thrown by the throwing API overloads and by Result::value_or_throw()."
---

<!-- Generated by tools/doxygen2mdx from Doxygen XML. Do not edit. -->

<span class="api-kind api-kind--class">class</span>

**Header:** `ClikaRT/common/result.h`  
**Inherits:** `std::exception`

Thrown by the throwing API overloads and by [Result::value\_or\_throw()](./Result.md#value_or_throw).

Marked exported so its typeinfo carries default visibility and is kept in the `.so`'s dynamic symbols (see the export map's "typeinfo for ClikaRT::\*"). The public API throws this caller-side (the inline header wrapper value\_or\_throw()s the library's [Result](./Result.md)), so most catches never cross the `.so`; the export is needed for the one place that does: the nn override seam, where your `Module::output_shapes`/`compute` override throws an [`Error`](./Error.md) that the library's `dispatch` try/catch (inside the `.so`) catches, so the two modules' typeinfos must coalesce (a `-fvisibility=hidden` build would otherwise localize it and the catch would miss).

## Member functions

### Error(Status, string) {#Error}

<div class="api-signature">

**`Error`**([`Status`](../index.md#Status) `status`, `std::string` `message`)

</div>

A failure with the coarse [`status`](./Error.md#status) and a readable `message`.

<div class="api-declared">

Declared in `ClikaRT/common/result.h`, line 118

</div>

### Error(Status, string, string) {#Error-2}

<div class="api-signature">

**`Error`**(<br />
&nbsp;&nbsp;&nbsp;&nbsp;[`Status`](../index.md#Status) `status`,<br />
&nbsp;&nbsp;&nbsp;&nbsp;`std::string` `message`,<br />
&nbsp;&nbsp;&nbsp;&nbsp;`std::string` `code_name`<br />
)

</div>

A failure additionally carrying the fine-grained status name (machine-readable in every build; see [`code_name()`](./Error.md#code_name)).

<div class="api-declared">

Declared in `ClikaRT/common/result.h`, line 122

</div>

### status() {#status}

<div class="api-signature">

[`Status`](../index.md#Status) **`status`**() `const noexcept`

</div>

the coarse status classification

<div class="api-declared">

Declared in `ClikaRT/common/result.h`, line 125

</div>

### what() {#what}

<div class="api-signature">

`const char*` **`what`**() `const noexcept override`

</div>

The message (std::exception surface). A failure you can act on (a bad shape, an option out of range, a missing file, an unreachable server) reads as plain text in every build and names the value it refuses. A message of the form `E<digits>` is an internal fault code: it stands for a defect inside the runtime, its value is specific to the build that produced it (it changes between releases), and it is not an identifier to record, compare, or branch on. Report it verbatim together with the runtime version; branch on [`code_name()`](./Error.md#code_name).

<div class="api-declared">

Declared in `ClikaRT/common/result.h`, line 134

</div>

### code\_name() {#code_name}

<div class="api-signature">

`const std::string&` **`code_name`**() `const noexcept`

</div>

The stable NAME the failure originated with: a runtime status name (e.g. "TIMED\_OUT", "BACKEND\_NOT\_LOADED") or the name a consumer's model minted (an [`Error`](./Error.md) raised inside a phase body crosses the engine and comes back with its own [`code_name`](./Error.md#code_name) unchanged); empty when the error carries no name. Machine-readable in EVERY build; it survives release obfuscation even when the message is an opaque code. [`status()`](./Error.md#status) remains the coarse switch.

<div class="api-declared">

Declared in `ClikaRT/common/result.h`, line 142

</div>
