<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 16.0.0 -",
    "macOS: 13.0.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: -",
    "watchOS: 9.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Swift",
  "identifier" : "/documentation/Distributed/DistributedTargetInvocationDecoder/decodeErrorType()",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Distributed"
    ],
    "preciseIdentifier" : "s:11Distributed0A23TargetInvocationDecoderP15decodeErrorTypeypXpSgyKF"
  },
  "title" : "decodeErrorType()"
}
-->

# decodeErrorType()

Decode the specific error type that the distributed invocation target has recorded.
Currently this effectively can only ever be `Error.self`.

```
mutating func decodeErrorType() throws -> (any Any.Type)?
```

## Discussion

If the target known to not be throwing, or no error type was recorded, the method should return `nil`.

---

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)