Skip to content

Commit

Permalink
detekt
Browse files Browse the repository at this point in the history
  • Loading branch information
MohamadJaara committed Jun 21, 2024
1 parent 5425ed6 commit 93563df
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ sealed class ConversationRepository {
throw WebApplicationException("Instance ${instance.instanceId}: Could not get recent messages")
}

@Suppress("LongParameterList", "LongMethod", "ThrowsCount")
@Suppress("LongParameterList", "LongMethod", "ThrowsCount", "ComplexMethod")
suspend fun sendFile(
instance: Instance,
conversationId: ConversationId,
Expand Down Expand Up @@ -335,10 +335,12 @@ sealed class ConversationRepository {
// first check kotlin version
// if version < 2 then casting is necessary
// if version >= 2 then casting is unnecessary
when(val result = sendResult as ScheduleNewAssetMessageResult.Failure) {
when (val result = sendResult as ScheduleNewAssetMessageResult.Failure) {
ScheduleNewAssetMessageResult.Failure.RestrictedFileType,
ScheduleNewAssetMessageResult.Failure.DisabledByTeam -> {
throw WebApplicationException("Instance ${instance.instanceId}: Sending failed with $sendResult")
throw WebApplicationException(
"Instance ${instance.instanceId}: Sending failed with $sendResult"
)
}

is ScheduleNewAssetMessageResult.Failure.Generic -> {
Expand Down Expand Up @@ -376,7 +378,7 @@ sealed class ConversationRepository {
}
}

@Suppress("LongParameterList")
@Suppress("LongParameterList", "ThrowsCount")
suspend fun sendImage(
instance: Instance,
conversationId: ConversationId,
Expand Down

0 comments on commit 93563df

Please sign in to comment.