---
title: CacheError
summary: Errors arising from cache operations.
url: https://www.fastly.com/documentation/reference/compute/sdks/cpp/fastly/cache/simple/class.CacheError/
---

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

Include `fastly/cache/simple.h` to use this class.

Errors arising from cache operations.

## Constructor

**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/cache/simple.h#L39

```cpp
fastly::cache::simple::CacheError::CacheError(Code code)
```

**Parameters**

- `code`: `Code`

## Methods

### code

**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/cache/simple.h#L40

```cpp
Code fastly::cache::simple::CacheError::code() const
```

**Returns**

`Code`
