<!--
{
  "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

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

An error code that represents the absence of any problems.

[`MTLBinaryArchiveErrorInvalidFile`](/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.

[`MTLBinaryArchiveErrorCompilationFailure`](/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.

[`MTLBinaryArchiveErrorUnexpectedElement`](/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.

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

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

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

An error code that represents the absence of any problems.

[`MTLBinaryArchiveErrorInvalidFile`](/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.

[`MTLBinaryArchiveErrorCompilationFailure`](/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.

[`MTLBinaryArchiveErrorUnexpectedElement`](/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.

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

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

## Relationships

### Conforms To

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

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

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

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

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

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