Handle JobCancellationException

This commit is contained in:
Benoit Marty 2020-07-05 23:41:19 +02:00
parent 2a68c8d08b
commit e7f13c9efe
2 changed files with 3 additions and 3 deletions

View File

@ -73,6 +73,9 @@ abstract class AbstractLoginFragment : VectorBaseFragment(), OnBackPressed {
override fun showFailure(throwable: Throwable) {
when (throwable) {
is Failure.Cancelled ->
/* Ignore this error, user has cancelled the action */
Unit
is Failure.ServerError ->
if (throwable.error.code == MatrixError.M_FORBIDDEN
&& throwable.httpCode == HttpsURLConnection.HTTP_FORBIDDEN /* 403 */) {

View File

@ -436,7 +436,6 @@ class LoginViewModel @AssistedInject constructor(
}
override fun onFailure(failure: Throwable) {
// TODO Handled JobCancellationException
setState {
copy(
asyncResetPassword = Fail(failure)
@ -478,7 +477,6 @@ class LoginViewModel @AssistedInject constructor(
}
override fun onFailure(failure: Throwable) {
// TODO Handled JobCancellationException
setState {
copy(
asyncResetMailConfirmed = Fail(failure)
@ -593,7 +591,6 @@ class LoginViewModel @AssistedInject constructor(
}
override fun onFailure(failure: Throwable) {
// TODO Handled JobCancellationException
setState {
copy(
asyncLoginAction = Fail(failure)