---
title: CSSearchQueryError.Code
framework: Core Spotlight
role: symbol
role_heading: Enumeration
platforms: [iOS 10.0+, iPadOS 10.0+, Mac Catalyst 13.1+, macOS 10.12+, visionOS 1.0+]
path: corespotlight/cssearchqueryerror/code
---

# CSSearchQueryError.Code

Error codes that describe reasons a query might fail.

## Declaration

```swift
enum Code
```

## Topics

### Getting the error codes

- [CSSearchQueryError.Code.cancelled](corespotlight/cssearchqueryerror/code/cancelled.md)
- [CSSearchQueryError.Code.indexUnreachable](corespotlight/cssearchqueryerror/code/indexunreachable.md)
- [CSSearchQueryError.Code.invalidQuery](corespotlight/cssearchqueryerror/code/invalidquery.md)
- [CSSearchQueryError.Code.unknown](corespotlight/cssearchqueryerror/code/unknown.md)

### Creating a query error

- [init(rawValue:)](corespotlight/cssearchqueryerror/code/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)
