Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ internal final class InternalRealtimeClientAdapter<Underlying: ProxyRealtimeClie
}
}.get()
} catch {
throw error.toInternalError()
throw InternalError.fromAblyCocoa(error)
}
Comment thread
lawrence-forooghian marked this conversation as resolved.
}
}
Expand Down Expand Up @@ -234,7 +234,7 @@ internal final class InternalRealtimePresenceAdapter<Underlying: RealtimePresenc
}
}.get()
} catch {
throw error.toInternalError()
throw InternalError.fromAblyCocoa(error)
}
}

Expand All @@ -252,7 +252,7 @@ internal final class InternalRealtimePresenceAdapter<Underlying: RealtimePresenc
}
}.get()
} catch {
throw error.toInternalError()
throw InternalError.fromAblyCocoa(error)
}
}

Expand All @@ -268,7 +268,7 @@ internal final class InternalRealtimePresenceAdapter<Underlying: RealtimePresenc
}
}.get()
} catch {
throw error.toInternalError()
throw InternalError.fromAblyCocoa(error)
}
}

Expand All @@ -284,7 +284,7 @@ internal final class InternalRealtimePresenceAdapter<Underlying: RealtimePresenc
}
}.get()
} catch {
throw error.toInternalError()
throw InternalError.fromAblyCocoa(error)
}
}

Expand All @@ -300,7 +300,7 @@ internal final class InternalRealtimePresenceAdapter<Underlying: RealtimePresenc
}
}.get()
} catch {
throw error.toInternalError()
throw InternalError.fromAblyCocoa(error)
}
}

Expand Down Expand Up @@ -358,7 +358,7 @@ internal final class InternalRealtimeChannelAdapter<Underlying: ProxyRealtimeCha
}
}.get()
} catch {
throw error.toInternalError()
throw InternalError.fromAblyCocoa(error)
}
}

Expand All @@ -374,7 +374,7 @@ internal final class InternalRealtimeChannelAdapter<Underlying: ProxyRealtimeCha
}
}.get()
} catch {
throw error.toInternalError()
throw InternalError.fromAblyCocoa(error)
}
}

Expand All @@ -390,7 +390,7 @@ internal final class InternalRealtimeChannelAdapter<Underlying: ProxyRealtimeCha
}
}.get()
} catch {
throw error.toInternalError()
throw InternalError.fromAblyCocoa(error)
}
}

Expand Down
2 changes: 1 addition & 1 deletion Sources/AblyChat/DefaultMessageReactions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ internal final class DefaultMessageReactions: MessageReactions {
internal func delete(fromMessageWithSerial messageSerial: String, params: DeleteMessageReactionParams) async throws(ARTErrorInfo) {
let reactionType = params.type ?? options.defaultMessageReactionType
if reactionType != .unique, params.name == nil {
throw ARTErrorInfo(chatError: .unableDeleteReactionWithoutName(reactionType: reactionType.rawValue))
throw InternalError.internallyThrown(.unableDeleteReactionWithoutName(reactionType: reactionType.rawValue)).toARTErrorInfo()
}
do {
let apiParams: ChatAPI.DeleteMessageReactionParams = .init(
Expand Down
4 changes: 2 additions & 2 deletions Sources/AblyChat/DefaultMessages.swift
Original file line number Diff line number Diff line change
Expand Up @@ -179,11 +179,11 @@ internal final class DefaultMessages: Messages {
continuation.resume(returning: .success(subscriptionPoint))
} else {
logger.log(message: "Channel is attached, but attachSerial is not defined", level: .error)
continuation.resume(returning: .failure(ARTErrorInfo(chatError: .attachSerialIsNotDefined).toInternalError()))
continuation.resume(returning: .failure(InternalError.internallyThrown(.attachSerialIsNotDefined)))
}
case .failed, .suspended:
// TODO: Revisit as part of https://github.com/ably-labs/ably-chat-swift/issues/32
let error = ARTErrorInfo(chatError: .channelFailedToAttach(cause: stateChange.reason)).toInternalError()
let error = InternalError.internallyThrown(.channelFailedToAttach(cause: stateChange.reason))
logger.log(message: "\(error)", level: .error)
continuation.resume(returning: .failure(error))
default:
Expand Down
Loading