Initial commit

Add Space version 2.0.1
This commit is contained in:
friebetill
2022-03-28 14:56:00 +02:00
commit 80f218097d
1258 changed files with 59763 additions and 0 deletions

View File

@ -0,0 +1,17 @@
import '../../../graphql/operation_exception.dart';
import '../../../i18n/i18n.dart';
/// Returns the most fitting error text for the given [exception].
///
/// In case no good message can be found, a generic error message is returned.
String getErrorText(S i18n, Exception exception) {
if (exception is OperationException) {
if (exception.isNoInternet) {
return i18n.errorNoInternetText;
} else if (exception.isServerOffline) {
return i18n.errorWeWillFixText;
}
}
return i18n.errorUnknownText;
}