You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please separate your exceptions more uniquely as there is no way of operating special use-cases.
Functions throwing a IllegalStateException:
spec (2x)
dispatch
checkSpecBlockSet
Maybe create something like this?
Didn't create PR as I'm not sure how you want to adopt things, but here a simple example:
sealedinterfaceFlowReduxException {
data objectAlreadyInitialized : IllegalStateException(
"State machine spec has already been set. " +
"It's only allowed to call spec {...} once.",
), FlowReduxException
data objectAlreadyCollected : IllegalStateException(
"Can not collect state more than once at the same time. Make sure the" +
"previous collection is cancelled before starting a new one. " +
"Collecting state in parallel would lead to subtle bugs.",
), FlowReduxException
data objectNotInitialized : IllegalStateException(
""" No state machine specs are defined. Did you call spec { ... } in init {...}? Example usage: class MyStateMachine : FlowReduxStateMachine<State, Action>(InitialState) { init{ spec { inState<FooState> { on<BarAction> { ... } } ... } } }""".trimIndent(),
), FlowReduxException
data classNotCollected(valaction:A) : IllegalStateException(
"Cannot dispatch action $action because state Flow of this " +
"FlowReduxStateMachine is not collected yet. " +
"Start collecting the state Flow before dispatching any action.",
), FlowReduxException
}
The text was updated successfully, but these errors were encountered:
I would want to ignore NotCollected exceptions and not all IllegalStateException FlowRedux throws.
Sure that's pretty easy as it's only thrown in dispatch but it's way easier to keep track of it in the code then.
Additionally Firebase Crashlytics for example summarize exceptions and send reports per mail.
However this mails just show that it's a IllegalStateException, not where it's thrown.
Overall it just improves code and crash report readability
Please separate your exceptions more uniquely as there is no way of operating special use-cases.
Functions throwing a
IllegalStateException
:spec
(2x)dispatch
checkSpecBlockSet
Maybe create something like this?
Didn't create PR as I'm not sure how you want to adopt things, but here a simple example:
The text was updated successfully, but these errors were encountered: