Enable detekt rule ThrowingExceptionsWithoutMessageOrCause and fix existing issues.
This commit is contained in:
@@ -41,7 +41,7 @@ open class CreateRoomRootStateProvider : PreviewParameterProvider<CreateRoomRoot
|
||||
}
|
||||
),
|
||||
aCreateRoomRootState().copy(
|
||||
startDmAction = Async.Failure(Throwable()),
|
||||
startDmAction = Async.Failure(Throwable("error")),
|
||||
userListState = aMatrixUser().let {
|
||||
aUserListState().copy(
|
||||
searchQuery = it.userId.value,
|
||||
|
||||
@@ -25,7 +25,7 @@ open class WaitListStateProvider : PreviewParameterProvider<WaitListState> {
|
||||
get() = sequenceOf(
|
||||
aWaitListState(loginAction = Async.Uninitialized),
|
||||
aWaitListState(loginAction = Async.Loading()),
|
||||
aWaitListState(loginAction = Async.Failure(Throwable())),
|
||||
aWaitListState(loginAction = Async.Failure(Throwable("error"))),
|
||||
aWaitListState(loginAction = Async.Failure(Throwable(message = "IO_ELEMENT_X_WAIT_LIST"))),
|
||||
aWaitListState(loginAction = Async.Success(SessionId("@alice:element.io"))),
|
||||
// Add other state here
|
||||
|
||||
@@ -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"))),
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -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())
|
||||
|
||||
@@ -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
|
||||
)
|
||||
|
||||
@@ -95,9 +95,9 @@ object PermalinkParser {
|
||||
return if (signUrl.isNullOrEmpty().not() && email.isNullOrEmpty().not()) {
|
||||
try {
|
||||
val signValidUri = Uri.parse(signUrl)
|
||||
val identityServerHost = signValidUri.authority ?: throw IllegalArgumentException()
|
||||
val token = signValidUri.getQueryParameter("token") ?: throw IllegalArgumentException()
|
||||
val privateKey = signValidUri.getQueryParameter("private_key") ?: throw IllegalArgumentException()
|
||||
val identityServerHost = signValidUri.authority ?: throw IllegalArgumentException("missing `authority`")
|
||||
val token = signValidUri.getQueryParameter("token") ?: throw IllegalArgumentException("missing `token`")
|
||||
val privateKey = signValidUri.getQueryParameter("private_key") ?: throw IllegalArgumentException("missing `private_key`")
|
||||
PermalinkData.RoomEmailInviteLink(
|
||||
roomId = identifier,
|
||||
email = email!!,
|
||||
|
||||
@@ -56,7 +56,7 @@ exceptions:
|
||||
SwallowedException:
|
||||
active: false
|
||||
ThrowingExceptionsWithoutMessageOrCause:
|
||||
active: false
|
||||
active: true
|
||||
TooGenericExceptionThrown:
|
||||
active: false
|
||||
InstanceOfCheckForException:
|
||||
|
||||
Reference in New Issue
Block a user