Enable detekt rule ThrowingExceptionsWithoutMessageOrCause and fix existing issues.

This commit is contained in:
Benoit Marty 2023-07-26 10:33:51 +02:00
parent d82b47beeb
commit f055a25457
7 changed files with 9 additions and 9 deletions

View file

@ -30,7 +30,7 @@ open class AttachmentsPreviewStateProvider : PreviewParameterProvider<Attachment
anAttachmentsPreviewState(),
anAttachmentsPreviewState(mediaInfo = aFileInfo()),
anAttachmentsPreviewState(sendActionState = SendActionState.Sending.Uploading(0.5f)),
anAttachmentsPreviewState(sendActionState = SendActionState.Failure(RuntimeException())),
anAttachmentsPreviewState(sendActionState = SendActionState.Failure(RuntimeException("error"))),
)
}

View file

@ -32,7 +32,7 @@ open class MediaViewerStateProvider : PreviewParameterProvider<MediaViewerState>
get() = sequenceOf(
aMediaViewerState(),
aMediaViewerState(Async.Loading()),
aMediaViewerState(Async.Failure(IllegalStateException())),
aMediaViewerState(Async.Failure(IllegalStateException("error"))),
aMediaViewerState(
Async.Success(
LocalMedia(Uri.EMPTY, anImageInfo())

View file

@ -26,7 +26,7 @@ open class ReportMessageStateProvider : PreviewParameterProvider<ReportMessageSt
aReportMessageState(reason = "This user is making the chat very toxic."),
aReportMessageState(reason = "This user is making the chat very toxic.", blockUser = true),
aReportMessageState(reason = "This user is making the chat very toxic.", blockUser = true, result = Async.Loading()),
aReportMessageState(reason = "This user is making the chat very toxic.", blockUser = true, result = Async.Failure(Throwable())),
aReportMessageState(reason = "This user is making the chat very toxic.", blockUser = true, result = Async.Failure(Throwable("error"))),
aReportMessageState(reason = "This user is making the chat very toxic.", blockUser = true, result = Async.Success(Unit)),
// Add other states here
)