---
title: XCTestError.Code
framework: xctest
role: symbol
role_heading: Enumeration
path: xctest/xctesterror/code
---

# XCTestError.Code

Error codes for errors that can occur while the test is waiting to fulfill expectations.

## Declaration

```swift
enum Code
```

## Topics

### Error Codes

- [XCTestError.Code.timeoutWhileWaiting](xctest/xctesterror/code/timeoutwhilewaiting.md)
- [XCTestError.Code.failureWhileWaiting](xctest/xctesterror/code/failurewhilewaiting.md)

### Initializers

- [init(rawValue:)](xctest/xctesterror/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)

## See Also

### Waiting for Expectations

- [fulfillment(of:timeout:enforceOrder:)](xctest/xctestcase/fulfillment(of:timeout:enforceorder:).md)
- [wait(for:)](xctest/xctestcase/wait(for:).md)
- [wait(for:enforceOrder:)](xctest/xctestcase/wait(for:enforceorder:).md)
- [wait(for:timeout:)](xctest/xctestcase/wait(for:timeout:).md)
- [wait(for:timeout:enforceOrder:)](xctest/xctestcase/wait(for:timeout:enforceorder:).md)
- [waitForExpectations(timeout:handler:)](xctest/xctestcase/waitforexpectations(timeout:handler:).md)
- [XCWaitCompletionHandler](xctest/xcwaitcompletionhandler.md)
- [XCTestError](xctest/xctesterror.md)
- [XCTestErrorDomain](xctest/xctesterrordomain.md)
