You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Sources/AblyChat/Errors.swift
+7-9Lines changed: 7 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -11,10 +11,8 @@ public let errorDomain = "AblyChatErrorDomain"
11
11
The error codes for errors in the ``errorDomain`` error domain.
12
12
*/
13
13
publicenumErrorCode:Int{
14
-
/// ``Rooms/get(roomID:options:)`` was called with a different set of room options than was used on a previous call. You must first release the existing room instance using ``Rooms/release(roomID:)``.
15
-
///
16
-
/// TODO this code is a guess, revisit in https://github.com/ably-labs/ably-chat-swift/issues/32
17
-
case inconsistentRoomOptions =1
14
+
/// The user attempted to perform an invalid action.
15
+
case badRequest =40000
18
16
19
17
/**
20
18
* The messages feature failed to attach.
@@ -90,7 +88,7 @@ public enum ErrorCode: Int {
90
88
91
89
/// Has a case for each of the ``ErrorCode`` cases that imply a fixed status code.
92
90
internalenumCaseThatImpliesFixedStatusCode{
93
-
caseinconsistentRoomOptions
91
+
casebadRequest
94
92
case messagesAttachmentFailed
95
93
case presenceAttachmentFailed
96
94
case reactionsAttachmentFailed
@@ -108,8 +106,8 @@ public enum ErrorCode: Int {
108
106
109
107
internalvartoNumericErrorCode:ErrorCode{
110
108
switchself{
111
-
case.inconsistentRoomOptions:
112
-
.inconsistentRoomOptions
109
+
case.badRequest:
110
+
.badRequest
113
111
case.messagesAttachmentFailed:
114
112
.messagesAttachmentFailed
115
113
case.presenceAttachmentFailed:
@@ -145,7 +143,7 @@ public enum ErrorCode: Int {
145
143
internalvarstatusCode:Int{
146
144
// These status codes are taken from the "Chat-specific Error Codes" section of the spec.
// Post-test: Allow the CHA-RC1g release operation to complete
@@ -251,7 +251,7 @@ struct DefaultRoomsTests {
251
251
// When: `release(roomID:)` is called with this room ID
252
252
// Then: The call to `release(roomID:)` completes (this is as much as I can do to test the spec’s “no-op”; i.e. check it doesn’t seem to wait for anything or have any obvious side effects)
253
253
letroomID="basketball"
254
-
tryawait rooms.release(roomID: roomID)
254
+
await rooms.release(roomID: roomID)
255
255
}
256
256
257
257
// @spec CHA-RC1g3
@@ -290,7 +290,7 @@ struct DefaultRoomsTests {
290
290
roomReleaseOperation.complete()
291
291
292
292
// Then: The second call to `release(roomID:)` completes, and this second release call does not trigger a CHA-RL3 room release operation (i.e. in the language of the spec it reuses the “future” of the existing CHA-RC1g release operation)
293
-
tryawait secondReleaseResult
293
+
await secondReleaseResult
294
294
#expect(await roomToReturn.releaseCallCount ==1)
295
295
}
296
296
@@ -344,7 +344,7 @@ struct DefaultRoomsTests {
344
344
roomReleaseOperation.complete()
345
345
346
346
// Then: The second call to `release(roomID:)` completes, and this second release call does not trigger a CHA-RL3 room release operation (i.e. in the language of the spec it reuses the “future” of the existing CHA-RC1g release operation)
0 commit comments