<!--
{
  "availability" : [
    "iOS: 11.0.0 -",
    "iPadOS: 11.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.13.0 -",
    "tvOS: 11.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 4.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreML",
  "identifier" : "/documentation/CoreML/MLModelError-swift.struct",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Core ML"
    ],
    "preciseIdentifier" : "s:SC12MLModelErrorLeV"
  },
  "title" : "MLModelError"
}
-->

# MLModelError

Information about a Core ML model error.

```
struct MLModelError
```

## Topics

### Error Codes

[`static var featureType: MLModelError.Code`](/documentation/CoreML/MLModelError-swift.struct/featureType)

An error code for problems related to model features.

[`static var parameters: MLModelError.Code`](/documentation/CoreML/MLModelError-swift.struct/parameters)

An error code for problems related to model parameters.

[`static var modelCollection: MLModelError.Code`](/documentation/CoreML/MLModelError-swift.struct/modelCollection)

An error code for problems related to retrieving a model collection from the deployment system.

[`static var modelDecryptionKeyFetch: MLModelError.Code`](/documentation/CoreML/MLModelError-swift.struct/modelDecryptionKeyFetch)

An error code for problems related to retrieving a model’s decryption key.

[`static var modelDecryption: MLModelError.Code`](/documentation/CoreML/MLModelError-swift.struct/modelDecryption)

An error code for problems related to decrypting models.

[`static var update: MLModelError.Code`](/documentation/CoreML/MLModelError-swift.struct/update)

An error code for problems related to on-device model updates.

[`static var customLayer: MLModelError.Code`](/documentation/CoreML/MLModelError-swift.struct/customLayer)

An error code for problems related to custom layers.

[`static var customModel: MLModelError.Code`](/documentation/CoreML/MLModelError-swift.struct/customModel)

An error code for problems related to custom models.

[`static var io: MLModelError.Code`](/documentation/CoreML/MLModelError-swift.struct/io)

An error code for problems related to the system’s input or output.

[`static var predictionCancelled: MLModelError.Code`](/documentation/CoreML/MLModelError-swift.struct/predictionCancelled)

An error code for problems related to cancelling the prediction before it completes.

[`static var generic: MLModelError.Code`](/documentation/CoreML/MLModelError-swift.struct/generic)

An error code for runtime issues that don’t apply to the other error codes.

[`enum Code`](/documentation/CoreML/MLModelError-swift.struct/Code)

Information about a Core ML model error.

### Error Domain

[`let MLModelErrorDomain: String`](/documentation/CoreML/MLModelErrorDomain)

The domain for Core ML errors.

[`static var errorDomain: String`](/documentation/CoreML/MLModelError-swift.struct/errorDomain)

## Relationships

### Conforms To

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

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

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

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

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

[`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)