Skip to content

Commit

Permalink
Replace this throw expression with error("").
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinBoulongne committed Jun 4, 2024
1 parent de8f8e1 commit 7767b7e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ class ThreadController @Inject constructor(
ThreadFilter.STARRED -> "${Thread::isFavorite.name} == true"
ThreadFilter.ATTACHMENTS -> "${Thread::hasAttachments.name} == true"
ThreadFilter.FOLDER -> TODO()
else -> throw IllegalStateException("`${ThreadFilter::class.simpleName}` cannot be `${ThreadFilter.ALL.name}` here.")
else -> error("`${ThreadFilter::class.simpleName}` cannot be `${ThreadFilter.ALL.name}` here.")
}
realmQuery.query(withFilter)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ class ThreadListFragment : TwoPaneFragment(), SwipeRefreshLayout.OnRefreshListen
val swipeAction = when (direction) {
SwipeDirection.LEFT_TO_RIGHT -> localSettings.swipeRight
SwipeDirection.RIGHT_TO_LEFT -> localSettings.swipeLeft
else -> throw IllegalStateException("Only SwipeDirection.LEFT_TO_RIGHT and SwipeDirection.RIGHT_TO_LEFT can be triggered")
else -> error("Only SwipeDirection.LEFT_TO_RIGHT and SwipeDirection.RIGHT_TO_LEFT can be triggered")
}

val isPermanentDeleteFolder = isPermanentDeleteFolder(item.folder.role)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ class FolderAdapter @Inject constructor(
onCollapseTransition?.invoke(false)
}
is SelectableMailboxItemView, is UnreadItemView -> {
throw IllegalStateException("`${this::class.simpleName}` cannot exists here. Only Folder classes are allowed")
error("`${this::class.simpleName}` cannot exists here. Only Folder classes are allowed")
}
}

Expand Down

0 comments on commit 7767b7e

Please sign in to comment.