Merge pull request #23 in BPHVB/mvm_core from bugfix/server_splash_alert to develop
* commit 'db51edc9146998e37c973e0a91de3492fb48472a': Logs when server sends error screen with no page. Popup to catch users on splash screen when server sends bad response
This commit is contained in:
commit
80b55ecfa7
@ -33,6 +33,7 @@ typedef void (^TextFieldErrorHandler)(NSArray * _Nonnull fieldErrors);
|
||||
@property (nonatomic) BOOL isGreedy;
|
||||
@property (nonatomic) UIAlertControllerStyle alertStyle;
|
||||
@property (nonatomic) MFAlertType type;
|
||||
@property (nonatomic) BOOL defaultAction;
|
||||
|
||||
@property (nonnull, strong, nonatomic) NSArray *fieldErrors;
|
||||
@property (nullable, nonatomic, copy) TextFieldErrorHandler textFieldErrorHandler;
|
||||
|
||||
@ -39,6 +39,7 @@
|
||||
|
||||
// only if actions are empty, then go inside and set OK as default action
|
||||
if (alert.type == MFAlertTypePopup && alert.actions.count == 0) {
|
||||
alert.defaultAction = YES;
|
||||
alert.actions = @[[UIAlertAction actionWithTitle:[MVMCoreGetterUtility hardcodedStringWithKey:HardcodedOK] style:UIAlertActionStyleDefault handler:nil]];
|
||||
}
|
||||
return alert;
|
||||
@ -119,6 +120,7 @@
|
||||
self.title = error.title;
|
||||
self.message = [NSString stringWithFormat:@"%@ (%@)",error.messageToDisplay,[error stringErrorCode]];
|
||||
self.actions = @[[UIAlertAction actionWithTitle:[MVMCoreGetterUtility hardcodedStringWithKey:HardcodedOK] style:UIAlertActionStyleDefault handler:nil]];
|
||||
self.defaultAction = YES;
|
||||
self.isGreedy = isGreedy;
|
||||
self.type = MFAlertTypePopup;
|
||||
self.alertStyle = UIAlertControllerStyleAlert;
|
||||
|
||||
@ -38,5 +38,6 @@ typedef NS_ENUM(NSInteger, ErrorCode) {
|
||||
ErrorCodeInvalidSettingType,
|
||||
ErrorCodeServerFailSendFaceIDHash,
|
||||
ErrorCodeSSL,
|
||||
ErrorCodeNoViewControllerToPresentOn
|
||||
ErrorCodeNoViewControllerToPresentOn,
|
||||
ErrorCodeNoErrorPageSent
|
||||
};
|
||||
|
||||
@ -480,10 +480,20 @@
|
||||
return;
|
||||
}
|
||||
|
||||
// Check if we should load a screen.
|
||||
if (loadObject.operation.backgroundLoad || (!error.errorScreenError && loadObject.requestParameters.noViewControllerToLoad) || (!error.nativeDrivenErrorScreen && loadObject.pageType.length == 0)) {
|
||||
|
||||
// No screen to load, finish the load.
|
||||
[MVMCoreLoadRequestOperation loadFinished:loadObject loadedViewController:nil errorObject:error];
|
||||
// If the server told us there is an error screen but did not provide the page, show a critical error and log so we can have them fix it.
|
||||
if (error.errorScreenError && !error.nativeDrivenErrorScreen && loadObject.pageType.length == 0) {
|
||||
error.logError = YES;
|
||||
error.errorScreenError = NO;
|
||||
error.location = [NSString stringWithFormat:@"%li-%@",(long)ErrorCodeNoErrorPageSent,error.location];
|
||||
[MVMCoreLoadRequestOperation handleError:error loadObject:loadObject showAlertForErrorIfApplicable:YES];
|
||||
[MVMCoreLoadRequestOperation loadFinished:loadObject loadedViewController:nil errorObject:error];
|
||||
} else {
|
||||
// No screen to load, finish the load.
|
||||
[MVMCoreLoadRequestOperation loadFinished:loadObject loadedViewController:nil errorObject:error];
|
||||
}
|
||||
} else {
|
||||
|
||||
// We have a screen to show.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user