> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/holoscan/sdk-user-guide/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/holoscan/sdk-user-guide/_mcp/server.

# holoscan::RuntimeError

> Class for runtime errors related to Holoscan SDK.

Class for runtime errors related to Holoscan SDK.

This class is used to hold runtime error message in Holoscan SDK.

If new error code is required to be added, it could be done by appending to the [ErrorCode](../enums/errorcode) class and respective error string to the ErrorStrings array.

```cpp showLineNumbers={false}
#include <holoscan/errors.hpp>
```

**Inherits from:** `std::runtime_error` (public)

---

## Constructors

### RuntimeError \[#runtimeerror]

#### Overload 1

explicit

```cpp showLineNumbers={false}
holoscan::RuntimeError::RuntimeError(
    holoscan::ErrorCode error_code
)
```

#### Overload 2

```cpp showLineNumbers={false}
holoscan::RuntimeError::RuntimeError(
    holoscan::ErrorCode error_code,
    const std::string &what_arg
)
```

#### Overload 3

```cpp showLineNumbers={false}
holoscan::RuntimeError::RuntimeError(
    holoscan::ErrorCode error_code,
    const char *what_arg
)
```

---

## Methods

### construct\_error\_message \[#constructerrormessage]

```cpp showLineNumbers={false}
static std::string holoscan::RuntimeError::construct_error_message(
    const holoscan::ErrorCode error_code,
    const char *what_arg
)
```

---

## Static methods

### error\_string \[#errorstring]

```cpp showLineNumbers={false}
static const char * holoscan::RuntimeError::error_string(
    const holoscan::ErrorCode error_code
)
```

Get the error string from the error code.

**Returns:** The converted error string in const char\*.

**Parameters**

**`error_code`** `const holoscan::ErrorCode`

The error code to be converted.

---

---

## Member variables

| Name                  | Type           | Description                            |
| --------------------- | -------------- | -------------------------------------- |
| `ErrorStrings` static | `const char *` | The error strings for each error code. |