mirror of
https://github.com/vector-im/element-android.git
synced 2024-11-16 02:05:06 +08:00
Handle JobCancellationException
This commit is contained in:
parent
2a68c8d08b
commit
e7f13c9efe
@ -73,6 +73,9 @@ abstract class AbstractLoginFragment : VectorBaseFragment(), OnBackPressed {
|
|||||||
|
|
||||||
override fun showFailure(throwable: Throwable) {
|
override fun showFailure(throwable: Throwable) {
|
||||||
when (throwable) {
|
when (throwable) {
|
||||||
|
is Failure.Cancelled ->
|
||||||
|
/* Ignore this error, user has cancelled the action */
|
||||||
|
Unit
|
||||||
is Failure.ServerError ->
|
is Failure.ServerError ->
|
||||||
if (throwable.error.code == MatrixError.M_FORBIDDEN
|
if (throwable.error.code == MatrixError.M_FORBIDDEN
|
||||||
&& throwable.httpCode == HttpsURLConnection.HTTP_FORBIDDEN /* 403 */) {
|
&& throwable.httpCode == HttpsURLConnection.HTTP_FORBIDDEN /* 403 */) {
|
||||||
|
@ -436,7 +436,6 @@ class LoginViewModel @AssistedInject constructor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun onFailure(failure: Throwable) {
|
override fun onFailure(failure: Throwable) {
|
||||||
// TODO Handled JobCancellationException
|
|
||||||
setState {
|
setState {
|
||||||
copy(
|
copy(
|
||||||
asyncResetPassword = Fail(failure)
|
asyncResetPassword = Fail(failure)
|
||||||
@ -478,7 +477,6 @@ class LoginViewModel @AssistedInject constructor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun onFailure(failure: Throwable) {
|
override fun onFailure(failure: Throwable) {
|
||||||
// TODO Handled JobCancellationException
|
|
||||||
setState {
|
setState {
|
||||||
copy(
|
copy(
|
||||||
asyncResetMailConfirmed = Fail(failure)
|
asyncResetMailConfirmed = Fail(failure)
|
||||||
@ -593,7 +591,6 @@ class LoginViewModel @AssistedInject constructor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun onFailure(failure: Throwable) {
|
override fun onFailure(failure: Throwable) {
|
||||||
// TODO Handled JobCancellationException
|
|
||||||
setState {
|
setState {
|
||||||
copy(
|
copy(
|
||||||
asyncLoginAction = Fail(failure)
|
asyncLoginAction = Fail(failure)
|
||||||
|
Loading…
Reference in New Issue
Block a user