---
title: CacheError
summary: Errors arising from cache operations.
url: https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/cache/core/enum.CacheError/
---

**Kind:** Enum  
**Module:** [core](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/cache/core/)  
**Package:** fastly 0.13.1  
**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/cache/core.rs#67

```rust
#[non_exhaustive]
pub enum CacheError {
    LimitExceeded,
    InvalidOperation,
    Unsupported,
    Timeout,
    Other(FastlyStatus),
}
```

Errors arising from cache operations.

## Variants

### LimitExceeded

Operation failed due to a limit.

### InvalidOperation

Operation was not valid to be performed given the state of the cached item.

### Unsupported

Cache operation is not supported.

### Timeout

The cache operation did not complete within the timeout supplied by the caller.

This is returned by timeout-bounded operations such as
[`PendingTransaction::wait_for()`](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/cache/core/struct.PendingTransaction/#method-wait_for) when the timeout elapses before the operation completes.

### Other

- `0`: `fastly_shared::FastlyStatus`

An unknown error occurred.

## Trait implementations

### impl Debug for CacheError

#### fmt

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/cache/core.rs#65

```rust
fn fmt(&self, f: &mut Formatter<'_>) -> Result
```

**Parameters**

- `self`: `&Self`
- `f`: `&mut $crate::fmt::Formatter`

**Returns**

`$crate::fmt::Result`

### impl Display for CacheError

#### fmt

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/cache/core.rs#65

```rust
fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result
```

**Parameters**

- `self`: `&Self`
- `__formatter`: `&mut ::core::fmt::Formatter`

**Returns**

`::core::fmt::Result`

### impl From<FastlyStatus> for CacheError

#### from

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/cache/core.rs#89

```rust
fn from(status: FastlyStatus) -> Self
```

**Parameters**

- `status`: `FastlyStatus`

**Returns**

`Self`

## Auto trait implementations

- `Freeze`
- `RefUnwindSafe`
- `Send`
- `Sync`
- `Unpin`
- `UnsafeUnpin`
- `UnwindSafe`

## Blanket implementations

- `Any`
- `Borrow<T>`
- `BorrowMut<T>`
- `Downcast`
- `DowncastSync`
- `ErasedDestructor`
- `From<T>`
- `Into<U>`
- `IntoEither`
- `Same`
- `ToString`
- `TryFrom<U>`
- `TryInto<U>`
