<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: 26.0.0 -",
    "macOS: 26.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: 26.0.0 -",
    "watchOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreVideo",
  "identifier" : "/documentation/CoreVideo/CVError",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Core Video"
    ],
    "preciseIdentifier" : "s:9CoreVideo7CVErrorV"
  },
  "title" : "CVError"
}
-->

# CVError

`CVError` wraps `CVReturn` values to present them as Swift Error values. This type is
used for all errors thrown in the CoreVideo framework. All `CVReturn` values are
provided as static constants.

```
@frozen struct CVError
```

## Topics

### Initializers

[`init?(rawValue: CVReturn)`](/documentation/CoreVideo/CVError/init(rawValue:))

Creates `CVError` with the given error code. Returns nil if `rawValue` is `kCVReturnSuccess`

### Instance Properties

[`var errorDescription: String?`](/documentation/CoreVideo/CVError/errorDescription)

Localized messages describing the error.

### Type Properties

[`static let allocationFailed: CVError`](/documentation/CoreVideo/CVError/allocationFailed)

The allocation for a buffer or buffer pool failed. Most likely because of lack of resources.

[`static let internalError: CVError`](/documentation/CoreVideo/CVError/internalError)

Error with an undetermined cause.

[`static let invalidArgument: CVError`](/documentation/CoreVideo/CVError/invalidArgument)

At least one of the arguments passed in is not valid. Either out of range or the wrong type.

[`static let invalidPixelBufferAttributes: CVError`](/documentation/CoreVideo/CVError/invalidPixelBufferAttributes)

A CVBuffer cannot be created with the given attributes.

[`static let invalidPixelFormat: CVError`](/documentation/CoreVideo/CVError/invalidPixelFormat)

The requested pixel format is not supported for the CVBuffer type.

[`static let invalidPoolAttributes: CVError`](/documentation/CoreVideo/CVError/invalidPoolAttributes)

A CVBufferPool cannot be created with the given attributes.

[`static let invalidSize: CVError`](/documentation/CoreVideo/CVError/invalidSize)

The requested size (most likely too big) is not supported for the CVBuffer type.

[`static let pixelBufferNotMetalCompatible: CVError`](/documentation/CoreVideo/CVError/pixelBufferNotMetalCompatible)

The Buffer cannot be used with Metal as either its size, pixel format or attributes are not supported by Metal.

[`static let poolAllocationFailed: CVError`](/documentation/CoreVideo/CVError/poolAllocationFailed)

The allocation for the buffer pool failed. Most likely because of lack of resources. Check if your parameters are in range.

[`static let retry: CVError`](/documentation/CoreVideo/CVError/retry)

A scan hasn’t completely traversed the CVBufferPool due to a concurrent operation. The client can retry the scan.

[`static let unsupported: CVError`](/documentation/CoreVideo/CVError/unsupported)

This operation is unsupported on this data type.

[`static let wouldExceedAllocationThreshold: CVError`](/documentation/CoreVideo/CVError/wouldExceedAllocationThreshold)

The allocation request failed because it would have exceeded a specified allocation threshold (see kCVPixelBufferPoolAllocationThresholdKey).

### Type Methods

[`static func check(CVReturn) throws(CVError)`](/documentation/CoreVideo/CVError/check(_:))

Throws an instance of `CVError` if `status` is not `kCVReturnSuccess`

## Relationships

### Conforms To

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

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

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

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

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

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

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

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

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

---

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)