TF-2928 Handle connection error exception
This commit is contained in:
@@ -188,11 +188,7 @@ abstract class BaseController extends GetxController
|
|||||||
void handleUrgentExceptionOnMobile({Failure? failure, Exception? exception}) {
|
void handleUrgentExceptionOnMobile({Failure? failure, Exception? exception}) {
|
||||||
logError('$runtimeType::handleUrgentExceptionOnMobile():Failure: $failure | Exception: $exception');
|
logError('$runtimeType::handleUrgentExceptionOnMobile():Failure: $failure | Exception: $exception');
|
||||||
if (exception is ConnectionError) {
|
if (exception is ConnectionError) {
|
||||||
if (currentOverlayContext != null && currentContext != null) {
|
_handleConnectionErrorException();
|
||||||
appToast.showToastErrorMessage(
|
|
||||||
currentOverlayContext!,
|
|
||||||
AppLocalizations.of(currentContext!).connectionError);
|
|
||||||
}
|
|
||||||
} else if (exception is BadCredentialsException) {
|
} else if (exception is BadCredentialsException) {
|
||||||
_executeBeforeUnloadAndLogOut();
|
_executeBeforeUnloadAndLogOut();
|
||||||
}
|
}
|
||||||
@@ -213,11 +209,7 @@ abstract class BaseController extends GetxController
|
|||||||
infinityToast: true,);
|
infinityToast: true,);
|
||||||
}
|
}
|
||||||
} else if (exception is ConnectionError) {
|
} else if (exception is ConnectionError) {
|
||||||
if (currentOverlayContext != null && currentContext != null) {
|
_handleConnectionErrorException();
|
||||||
appToast.showToastErrorMessage(
|
|
||||||
currentOverlayContext!,
|
|
||||||
AppLocalizations.of(currentContext!).connectionError);
|
|
||||||
}
|
|
||||||
} else if (exception is BadCredentialsException) {
|
} else if (exception is BadCredentialsException) {
|
||||||
_executeBeforeUnloadAndLogOut();
|
_executeBeforeUnloadAndLogOut();
|
||||||
}
|
}
|
||||||
@@ -228,6 +220,14 @@ abstract class BaseController extends GetxController
|
|||||||
clearDataAndGoToLoginPage();
|
clearDataAndGoToLoginPage();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void _handleConnectionErrorException() {
|
||||||
|
if (currentOverlayContext != null && currentContext != null) {
|
||||||
|
appToast.showToastErrorMessage(
|
||||||
|
currentOverlayContext!,
|
||||||
|
AppLocalizations.of(currentContext!).connectionError);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void handleFailureViewState(Failure failure) async {
|
void handleFailureViewState(Failure failure) async {
|
||||||
logError('$runtimeType::handleFailureViewState():Failure = $failure');
|
logError('$runtimeType::handleFailureViewState():Failure = $failure');
|
||||||
if (failure is LogoutOidcFailure) {
|
if (failure is LogoutOidcFailure) {
|
||||||
|
|||||||
Reference in New Issue
Block a user