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

# MTLLibraryError.Code

Error codes for Metal library errors.

```
enum Code
```

## Topics

### Errors

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

Metal couldn’t support the requested action.

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

The action caused an internal error.

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

The library or function failed to compile.

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

The library or function compiled successfully but generated warnings.

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

Metal couldn’t find the Metal source file.

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

Metal couldn’t find the specified Metal function.

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

Metal couldn’t support the requested action.

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

The action caused an internal error.

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

The library or function failed to compile.

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

The library or function compiled successfully but generated warnings.

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

Metal couldn’t find the Metal source file.

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

Metal couldn’t find the specified Metal function.



---

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)