TF-2928 Handle not network error exception
This commit is contained in:
@@ -197,17 +197,7 @@ abstract class BaseController extends GetxController
|
|||||||
void handleUrgentExceptionOnWeb({Failure? failure, Exception? exception}) {
|
void handleUrgentExceptionOnWeb({Failure? failure, Exception? exception}) {
|
||||||
logError('$runtimeType::handleUrgentExceptionOnWeb():Failure: $failure | Exception: $exception');
|
logError('$runtimeType::handleUrgentExceptionOnWeb():Failure: $failure | Exception: $exception');
|
||||||
if (exception is NoNetworkError) {
|
if (exception is NoNetworkError) {
|
||||||
if (currentOverlayContext != null && currentContext != null) {
|
_handleNotNetworkErrorException();
|
||||||
appToast.showToastMessage(
|
|
||||||
currentOverlayContext!,
|
|
||||||
AppLocalizations.of(currentContext!).no_internet_connection,
|
|
||||||
actionName: AppLocalizations.of(currentContext!).skip,
|
|
||||||
onActionClick: ToastView.dismiss,
|
|
||||||
leadingSVGIcon: imagePaths.icNotConnection,
|
|
||||||
backgroundColor: AppColor.textFieldErrorBorderColor,
|
|
||||||
textColor: Colors.white,
|
|
||||||
infinityToast: true,);
|
|
||||||
}
|
|
||||||
} else if (exception is ConnectionError) {
|
} else if (exception is ConnectionError) {
|
||||||
_handleConnectionErrorException();
|
_handleConnectionErrorException();
|
||||||
} else if (exception is BadCredentialsException) {
|
} else if (exception is BadCredentialsException) {
|
||||||
@@ -228,6 +218,20 @@ abstract class BaseController extends GetxController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void _handleNotNetworkErrorException() {
|
||||||
|
if (currentOverlayContext != null && currentContext != null) {
|
||||||
|
appToast.showToastMessage(
|
||||||
|
currentOverlayContext!,
|
||||||
|
AppLocalizations.of(currentContext!).no_internet_connection,
|
||||||
|
actionName: AppLocalizations.of(currentContext!).skip,
|
||||||
|
onActionClick: ToastView.dismiss,
|
||||||
|
leadingSVGIcon: imagePaths.icNotConnection,
|
||||||
|
backgroundColor: AppColor.textFieldErrorBorderColor,
|
||||||
|
textColor: Colors.white,
|
||||||
|
infinityToast: true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
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