display Unexpected error: {exception message} instead of Unknown error upon login
This commit is contained in:
committed by
Dat H. Pham
parent
9d54709fac
commit
03819a7a9b
@@ -114,6 +114,12 @@ class AppLocalizations {
|
||||
name: 'unknownError');
|
||||
}
|
||||
|
||||
String unexpectedError(String errorMessage) {
|
||||
return Intl.message('Unexpected error: $errorMessage',
|
||||
name: 'unexpectedError',
|
||||
args: [errorMessage]);
|
||||
}
|
||||
|
||||
String get search_folder {
|
||||
return Intl.message(
|
||||
'Search folder',
|
||||
|
||||
@@ -50,7 +50,11 @@ class ToastManager {
|
||||
} else if (exception is NoNetworkError) {
|
||||
return AppLocalizations.of(context).youAreOffline;
|
||||
} else {
|
||||
return null;
|
||||
try {
|
||||
return AppLocalizations.of(context).unexpectedError(exception.message);
|
||||
} catch(_) {
|
||||
return AppLocalizations.of(context).unexpectedError(exception.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user