---
title: CGError
framework: coregraphics
role: symbol
role_heading: Enumeration
path: coregraphics/cgerror
---

# CGError

A uniform type for result codes returned by functions in Core Graphics.

## Declaration

```swift
enum CGError
```

## Topics

### Constants

- [CGError.cannotComplete](coregraphics/cgerror/cannotcomplete.md)
- [CGError.failure](coregraphics/cgerror/failure.md)
- [CGError.illegalArgument](coregraphics/cgerror/illegalargument.md)
- [CGError.invalidConnection](coregraphics/cgerror/invalidconnection.md)
- [CGError.invalidContext](coregraphics/cgerror/invalidcontext.md)
- [CGError.invalidOperation](coregraphics/cgerror/invalidoperation.md)
- [CGError.noneAvailable](coregraphics/cgerror/noneavailable.md)
- [CGError.notImplemented](coregraphics/cgerror/notimplemented.md)
- [CGError.rangeCheck](coregraphics/cgerror/rangecheck.md)
- [CGError.success](coregraphics/cgerror/success.md)
- [CGError.typeCheck](coregraphics/cgerror/typecheck.md)

### Initializers

- [init(rawValue:)](coregraphics/cgerror/init(rawvalue:).md)

## Relationships

### Conforms To

- [BitwiseCopyable](swift/bitwisecopyable.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [RawRepresentable](swift/rawrepresentable.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Related Documentation

- [Quartz 2D Programming Guide](apple-archive/documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/Introduction.md)

### Enumerations

- [CGCaptureOptions](coregraphics/cgcaptureoptions.md)
- [CGColorConversionInfoTransformType](coregraphics/cgcolorconversioninfotransformtype.md)
- [CGColorRenderingIntent](coregraphics/cgcolorrenderingintent.md)
- [CGConfigureOption](coregraphics/cgconfigureoption.md)
- [CGDisplayChangeSummaryFlags](coregraphics/cgdisplaychangesummaryflags.md)
- [CGDisplayStreamFrameStatus](coregraphics/cgdisplaystreamframestatus.md)
- [CGDisplayStreamUpdateRectType](coregraphics/cgdisplaystreamupdaterecttype.md)
- [CGEventField](coregraphics/cgeventfield.md)
- [CGEventFilterMask](coregraphics/cgeventfiltermask.md)
- [CGEventFlags](coregraphics/cgeventflags.md)
- [CGEventMouseSubtype](coregraphics/cgeventmousesubtype.md)
- [CGEventSourceStateID](coregraphics/cgeventsourcestateid.md)
- [CGEventSuppressionState](coregraphics/cgeventsuppressionstate.md)
- [CGEventTapLocation](coregraphics/cgeventtaplocation.md)
- [CGEventTapOptions](coregraphics/cgeventtapoptions.md)
