Browse Source

Enable detekt rule `TooGenericExceptionThrown` and fix existing issue.

pull/967/head
Benoit Marty 1 year ago
parent
commit
bd0031445e
  1. 2
      libraries/architecture/src/main/kotlin/io/element/android/libraries/architecture/NodeInputs.kt
  2. 2
      tools/detekt/detekt.yml

2
libraries/architecture/src/main/kotlin/io/element/android/libraries/architecture/NodeInputs.kt

@ -23,5 +23,5 @@ import com.bumble.appyx.core.plugin.plugins
interface NodeInputs : Plugin interface NodeInputs : Plugin
inline fun <reified I : NodeInputs> Node.inputs(): I { inline fun <reified I : NodeInputs> Node.inputs(): I {
return plugins<I>().firstOrNull() ?: throw RuntimeException("Make sure to actually pass NodeInputs plugin to your node") return requireNotNull(plugins<I>().firstOrNull()) { "Make sure to actually pass NodeInputs plugin to your node" }
} }

2
tools/detekt/detekt.yml

@ -58,7 +58,7 @@ exceptions:
ThrowingExceptionsWithoutMessageOrCause: ThrowingExceptionsWithoutMessageOrCause:
active: true active: true
TooGenericExceptionThrown: TooGenericExceptionThrown:
active: false active: true
InstanceOfCheckForException: InstanceOfCheckForException:
active: true active: true

Loading…
Cancel
Save