-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Labels
enhancementNew feature or requestNew feature or request
Description
// now
viewModelScope.launch {
exceptionHandler.handle {
serverRequest()
}.catch<IllegalArgumentException> { // Specifying a specific exception class
// Some custom handler code
false // true - cancels ErrorPresenter; false - allows execution of ErrorsPresenter
}.execute() // Starts code execution in `handle` lambda
}
// suggestion
viewModelScope.launch {
isLoading = true
val result = exceptionHandler {
action {
serverRequest()
}
catch<IllegalAccessException> { exc ->
// Some custom handler code
false // true - cancels ErrorPresenter; false - allows execution of ErrorsPresenter
}
catch<IllegalArgumentException> { exc ->
// Some custom handler code
false // true - cancels ErrorPresenter; false - allows execution of ErrorsPresenter
}
finally {
isLoading = false
}
}
}
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request