---
title: IssueHandlingTrait
framework: testing
role: symbol
role_heading: Structure
path: testing/issuehandlingtrait
---

# IssueHandlingTrait

A type that allows transforming or filtering the issues recorded by a test.

## Declaration

```swift
struct IssueHandlingTrait
```

## Overview

Overview Use this type to observe or customize the issue(s) recorded by the test this trait is applied to. You can transform a recorded issue by copying it, modifying one or more of its properties, and returning the copy. You can observe recorded issues by returning them unmodified. Or you can suppress an issue by either filtering it using filterIssues(_:) or returning nil from the closure passed to compactMapIssues(_:). When an instance of this trait is applied to a suite, it is recursively inherited by all child suites and tests. To add this trait to a test, use one of the following functions: compactMapIssues(_:) filterIssues(_:)

## Topics

### Instance Methods

- [handleIssue(_:)](testing/issuehandlingtrait/handleissue(_:).md)

## Relationships

### Conforms To

- [Copyable](swift/copyable.md)
- [Escapable](swift/escapable.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)
- [SuiteTrait](testing/suitetrait.md)
- [TestScoping](testing/testscoping.md)
- [TestTrait](testing/testtrait.md)
- [Trait](testing/trait.md)

## See Also

### Supporting types

- [Bug](testing/bug.md)
- [Comment](testing/comment.md)
- [ConditionTrait](testing/conditiontrait.md)
- [ParallelizationTrait](testing/parallelizationtrait.md)
- [Tag](testing/tag.md)
- [Tag.List](testing/tag/list.md)
- [TimeLimitTrait](testing/timelimittrait.md)
