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
@@ -120,6 +120,16 @@
|
|||||||
"placeholders_order": [],
|
"placeholders_order": [],
|
||||||
"placeholders": {}
|
"placeholders": {}
|
||||||
},
|
},
|
||||||
|
"unexpectedError": "Unexpected error: {errorMessage}",
|
||||||
|
"@unexpectedError": {
|
||||||
|
"type": "text",
|
||||||
|
"placeholders_order": [
|
||||||
|
"errorMessage"
|
||||||
|
],
|
||||||
|
"placeholders": {
|
||||||
|
"errorMessage": {}
|
||||||
|
}
|
||||||
|
},
|
||||||
"search_folder": "Search folder",
|
"search_folder": "Search folder",
|
||||||
"@search_folder": {
|
"@search_folder": {
|
||||||
"type": "text",
|
"type": "text",
|
||||||
|
|||||||
@@ -114,6 +114,12 @@ class AppLocalizations {
|
|||||||
name: 'unknownError');
|
name: 'unknownError');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String unexpectedError(String errorMessage) {
|
||||||
|
return Intl.message('Unexpected error: $errorMessage',
|
||||||
|
name: 'unexpectedError',
|
||||||
|
args: [errorMessage]);
|
||||||
|
}
|
||||||
|
|
||||||
String get search_folder {
|
String get search_folder {
|
||||||
return Intl.message(
|
return Intl.message(
|
||||||
'Search folder',
|
'Search folder',
|
||||||
|
|||||||
@@ -50,7 +50,11 @@ class ToastManager {
|
|||||||
} else if (exception is NoNetworkError) {
|
} else if (exception is NoNetworkError) {
|
||||||
return AppLocalizations.of(context).youAreOffline;
|
return AppLocalizations.of(context).youAreOffline;
|
||||||
} else {
|
} 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