<!--
{
  "availability" : [
    "Xcode: 16.0.0 -",
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "swift: 6.0.0 -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "Testing",
  "identifier" : "/documentation/Testing/Issue/error",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Swift Testing"
    ],
    "preciseIdentifier" : "s:7Testing5IssueV5errors5Error_pSgvp"
  },
  "title" : "error"
}
-->

# error

The error which was associated with this issue, if any.

```
var error: (any Error)? { get }
```

## Discussion

The value of this property is non-`nil` when [`kind`](/documentation/Testing/Issue/kind-swift.property) is
[`Issue.Kind.errorCaught(_:)`](/documentation/Testing/Issue/Kind-swift.enum/errorCaught(_:)).

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)