Feature/4174 better error message when backend down

This commit is contained in:
Frank Rotermund
2023-03-07 12:28:55 +00:00
parent 5e8a1ae716
commit e435aebd55
5 changed files with 26 additions and 0 deletions
@@ -1021,6 +1021,17 @@ NSString *const AppDelegateUniversalLinkDidChangeNotification = @"AppDelegateUni
- (UIAlertController*)showAlertWithTitle:(NSString*)title message:(NSString*)message
{
// bwi: (#4174) handling of client errors that are shown when the backend is down
if ([title containsString:BWIBuildSettings.shared.clientErrorSearchTerm]) {
ServerDowntimeDefaultService *service = [[ServerDowntimeDefaultService alloc] init];
if ([service isDowntimeNow]) {
title = BWIL10n.standardErrorAlertTitleDowntime;
} else {
title = BWIL10n.standardErrorAlertTitleNoDowntime;
}
}
[_errorNotification dismissViewControllerAnimated:NO completion:nil];
_errorNotification = [UIAlertController alertControllerWithTitle:title message:message preferredStyle:UIAlertControllerStyleAlert];