<!--
{
  "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",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "s:SC21MTLBinaryArchiveErrorLeV"
  },
  "title" : "MTLBinaryArchiveError"
}
-->

# MTLBinaryArchiveError

An error that occurred when creating a binary shader archive.

```
struct MTLBinaryArchiveError
```

## Topics

### Error codes

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

An error code that represents the absence of any problems.

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

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

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

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

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

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

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

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

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

Error codes when creating binary archives of compiled shader code.

### Error domain

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

The current binary archive error domain.

[`MTLBinaryArchiveDomain`](/documentation/Metal/MTLBinaryArchiveDomain)

The domain for Metal binary archive errors.



---

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)