---
title: ExpectationFailedError
framework: testing
role: symbol
role_heading: Structure
path: testing/expectationfailederror
---

# ExpectationFailedError

A type describing an error thrown when an expectation fails during evaluation.

## Declaration

```swift
struct ExpectationFailedError
```

## Overview

Overview The testing library throws instances of this type when the #require() macro records an issue.

## Topics

### Instance Properties

- [expectation](testing/expectationfailederror/expectation.md)

## Relationships

### Conforms To

- [Error](swift/error.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Retrieving information about checked expectations

- [Expectation](testing/expectation.md)
