<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: 14.0.0 -",
    "macOS: 11.0.0 -",
    "tvOS: 14.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Metal",
  "identifier" : "/documentation/Metal/MTLBinaryArchiveError-swift.struct/Code",
  "metadataVersion" : "0.1.0",
  "role" : "Enumeration",
  "symbol" : {
    "kind" : "Enumeration",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "c:@E@MTLBinaryArchiveError"
  },
  "title" : "MTLBinaryArchiveError.Code"
}
-->

# MTLBinaryArchiveError.Code

Error codes when creating binary archives of compiled shader code.

```
enum Code
```

## Topics

### Error codes

[`MTLBinaryArchiveError.Code.none`](/documentation/Metal/MTLBinaryArchiveError-swift.struct/Code/none)

An error code that represents the absence of any problems.

[`MTLBinaryArchiveError.Code.invalidFile`](/documentation/Metal/MTLBinaryArchiveError-swift.struct/Code/invalidFile)

An error code that indicates an app is using an invalid reference to an archive file, typically related to a URL.

[`MTLBinaryArchiveError.Code.compilationFailure`](/documentation/Metal/MTLBinaryArchiveError-swift.struct/Code/compilationFailure)

An error code that indicates the archive’s inability to compile its contents, typically when serializing it to a URL.

[`MTLBinaryArchiveError.Code.unexpectedElement`](/documentation/Metal/MTLBinaryArchiveError-swift.struct/Code/unexpectedElement)

An error code that indicates a problem with a configuration, typically in a descriptor or an archive’s inability to add linked functions.

[`MTLBinaryArchiveError.Code.internalError`](/documentation/Metal/MTLBinaryArchiveError-swift.struct/Code/internalError)

An error code that indicates the Metal framework has an internal problem.

[`MTLBinaryArchiveError.Code.none`](/documentation/Metal/MTLBinaryArchiveError-swift.struct/Code/none)

An error code that represents the absence of any problems.

[`MTLBinaryArchiveError.Code.invalidFile`](/documentation/Metal/MTLBinaryArchiveError-swift.struct/Code/invalidFile)

An error code that indicates an app is using an invalid reference to an archive file, typically related to a URL.

[`MTLBinaryArchiveError.Code.compilationFailure`](/documentation/Metal/MTLBinaryArchiveError-swift.struct/Code/compilationFailure)

An error code that indicates the archive’s inability to compile its contents, typically when serializing it to a URL.

[`MTLBinaryArchiveError.Code.unexpectedElement`](/documentation/Metal/MTLBinaryArchiveError-swift.struct/Code/unexpectedElement)

An error code that indicates a problem with a configuration, typically in a descriptor or an archive’s inability to add linked functions.

[`MTLBinaryArchiveError.Code.internalError`](/documentation/Metal/MTLBinaryArchiveError-swift.struct/Code/internalError)

An error code that indicates the Metal framework has an internal problem.



---

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)