---
title: associatedError
framework: xctest
role: symbol
role_heading: Instance Property
path: xctest/xctissue-swift.struct/associatederror
---

# associatedError

An optional error to associate with a test issue.

## Declaration

```swift
var associatedError: (any Error)? { get set }
```

## See Also

### Issue Details

- [type](xctest/xctissue-swift.struct/type.md)
- [compactDescription](xctest/xctissue-swift.struct/compactdescription.md)
- [detailedDescription](xctest/xctissue-swift.struct/detaileddescription.md)
- [sourceCodeContext](xctest/xctissue-swift.struct/sourcecodecontext.md)
- [attachments](xctest/xctissue-swift.struct/attachments.md)
- [add(_:)](xctest/xctissue-swift.struct/add(_:).md)
