<!--
{
  "availability" : [
    "Xcode: 27.0.0 -",
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -",
    "macOS: 27.0.0 -",
    "visionOS: 27.0.0 -",
    "watchOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Evaluations",
  "identifier" : "/documentation/Evaluations/SubjectInferenceError",
  "metadataVersion" : "0.1.0",
  "role" : "Enumeration",
  "symbol" : {
    "kind" : "Enumeration",
    "modules" : [
      "Evaluations"
    ],
    "preciseIdentifier" : "s:11Evaluations21SubjectInferenceErrorO"
  },
  "title" : "SubjectInferenceError"
}
-->

# SubjectInferenceError

A value that describes a failure to produce a subject for a sample.

```
enum SubjectInferenceError
```

## Overview

The evaluation runner records these values in the `"SubjectInferenceError"` column of
[`detailed`](/documentation/Evaluations/EvaluationResult/detailed). The evaluation runner omits this column entirely
on a clean run where the run produces every subject successfully, so check for the column’s presence
before reading it.

```swift
let result = try await evaluation.run()
if result.detailed.containsColumn("SubjectInferenceError") {
    let column = result.detailed["SubjectInferenceError", SubjectInferenceError.self]
    for (index, failure) in column.enumerated() {
        if let failure {
            print("Sample \(index) failed: \(failure.localizedDescription)")
        }
    }
}
```

Rows with a `SubjectInferenceError` value also have a `nil` `Response`, so failed
samples are identifiable structurally. This is useful for filtering and re-running them.
This error is distinct from [`EvaluatorError`](/documentation/Evaluations/EvaluatorError), which covers failures that occur after subject
production succeeds.

## Topics

### Enumeration Cases

[`case failed(reason: String)`](/documentation/Evaluations/SubjectInferenceError/failed(reason:))

The subject method threw an error.

## Relationships

### Conforms To

[`Decodable`](/documentation/Swift/Decodable)

[`LocalizedError`](/documentation/Foundation/LocalizedError)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Encodable`](/documentation/Swift/Encodable)

[`Equatable`](/documentation/Swift/Equatable)

[`Error`](/documentation/Swift/Error)

[`Sendable`](/documentation/Swift/Sendable)

[`Hashable`](/documentation/Swift/Hashable)

---

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)