---
title: FastlyError
url: https://www.fastly.com/documentation/reference/compute/sdks/cpp/fastly/error/class.FastlyError/
---

**Kind:** Class  
**Module:** [error](https://www.fastly.com/documentation/reference/compute/sdks/cpp/fastly/error/)  
**Package:** compute-sdk-cpp 0.7.0  
**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/error.h#L12

Include `fastly/error.h` to use this class.

## Constructor

_Overload 1 of 2_

```cpp
fastly::error::FastlyError::FastlyError(fastly::sys::error::FastlyError *e)
```

**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/error.h#L14

**Parameters**

- `e`: `fastly::sys::error::FastlyError *`

_Overload 2 of 2_

```cpp
fastly::error::FastlyError::FastlyError(rust::Box<fastly::sys::error::FastlyError> e)
```

**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/error.h#L16

**Parameters**

- `e`: `rust::Box<fastly::sys::error::FastlyError>`

## Methods

### error_code

**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/error.h#L18

```cpp
FastlyErrorCode fastly::error::FastlyError::error_code()
```

**Returns**

`FastlyErrorCode`

### error_msg

**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/error.h#L19

```cpp
std::string fastly::error::FastlyError::error_msg()
```

**Returns**

`std::string`
