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

# MTLCommandEncoderErrorState

Possible error conditions for the command encoder’s commands.

```
enum MTLCommandEncoderErrorState
```

## Topics

### Getting the error state

[`MTLCommandEncoderErrorState.completed`](/documentation/Metal/MTLCommandEncoderErrorState/completed)

A state that indicates the GPU successfully executed the commands without any errors.

[`MTLCommandEncoderErrorState.pending`](/documentation/Metal/MTLCommandEncoderErrorState/pending)

An error state that indicates the GPU didn’t execute the commands.

[`MTLCommandEncoderErrorState.affected`](/documentation/Metal/MTLCommandEncoderErrorState/affected)

An error state that indicates the GPU failed to fully execute the commands because of an error.

[`MTLCommandEncoderErrorState.faulted`](/documentation/Metal/MTLCommandEncoderErrorState/faulted)

An error state that indicates the commands in the command buffer are the cause of an error.

[`MTLCommandEncoderErrorState.unknown`](/documentation/Metal/MTLCommandEncoderErrorState/unknown)

An error state that indicates the command buffer doesn’t know the state of its commands on the GPU.



---

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)