clearer exception handling in OIDCHttpClient::checkOIDCIsAvailable()
This commit is contained in:
committed by
Dat H. Pham
parent
03819a7a9b
commit
35b90ba87a
@@ -120,6 +120,13 @@ class AppLocalizations {
|
||||
args: [errorMessage]);
|
||||
}
|
||||
|
||||
String handshakeException(String errorMessage) {
|
||||
return Intl.message(
|
||||
'Handshake error in client: $errorMessage',
|
||||
name: 'handshakeException',
|
||||
args: [errorMessage]);
|
||||
}
|
||||
|
||||
String get search_folder {
|
||||
return Intl.message(
|
||||
'Search folder',
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:core/domain/exceptions/web_session_exception.dart';
|
||||
import 'package:core/presentation/state/failure.dart';
|
||||
import 'package:core/presentation/utils/app_toast.dart';
|
||||
@@ -49,6 +51,8 @@ class ToastManager {
|
||||
return AppLocalizations.of(context).notFoundSession;
|
||||
} else if (exception is NoNetworkError) {
|
||||
return AppLocalizations.of(context).youAreOffline;
|
||||
} else if (exception is HandshakeException) {
|
||||
return AppLocalizations.of(context).handshakeException(exception.osError?.message ?? '');
|
||||
} else {
|
||||
try {
|
||||
return AppLocalizations.of(context).unexpectedError(exception.message);
|
||||
|
||||
Reference in New Issue
Block a user