<!--
{
  "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/Code",
  "metadataVersion" : "0.1.0",
  "role" : "Enumeration",
  "symbol" : {
    "kind" : "Enumeration",
    "modules" : [
      "Core ML"
    ],
    "preciseIdentifier" : "c:@E@MLModelError"
  },
  "title" : "MLModelError.Code"
}
-->

# MLModelError.Code

Information about a Core ML model error.

```
enum Code
```

## Topics

### Error codes

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

An error code for problems related to model features.

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

An error code for problems related to model parameters.

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

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

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

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

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

An error code for problems related to decrypting models.

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

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

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

An error code for problems related to custom layers.

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

An error code for problems related to custom models.

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

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

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

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

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

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

### Error domain

[`MLModelErrorDomain`](/documentation/CoreML/MLModelErrorDomain)

The domain for Core ML errors.

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

### Creating a model error

[`init(rawValue:)`](/documentation/CoreML/MLModelError-swift.struct/Code/init(rawValue:))



---

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)