Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Threema/ThreemaFramework/SharedUI/   (Social Medium ©)  Datei vom 26.9.2026 mit Größe 2 kB image not shown  

SSL ErrorHandler.m   Interaktion und
PortierbarkeitUnknown

 

Spracherkennung für: .m vermutete Sprache: Lisp {Lisp[62] ABAP[39] Masm[31]} [Methode: maximale Elemente, drei Dimensionen]

#import "ErrorHandler.h"
#import "ThreemaFramework/ThreemaFramework-Swift.h"

#ifdef DEBUG
  static const DDLogLevel ddLogLevel = DDLogLevelVerbose;
#else
  static const DDLogLevel ddLogLevel = DDLogLevelWarning;
#endif
@interface ErrorHandler ()

@end

static ErrorHandler *errorHandler;

@implementation ErrorHandler

+ (instancetype)errorHandler {
    return [[ErrorHandler alloc] init];
}

+ (void)abortWithError:(nonnull NSError *)error {
    // Could called from background thread, since we have Core Data child context
    dispatch_async(dispatch_get_main_queue(), ^{
        [self abortWithError:error additionalText:nil];
    });
}

+ (void)abortWithError:(nonnull NSError *)error additionalText:(nullable NSString *)additionalText {
    DDLogError(@"Aborting: unresolved error %@, %@", error, [error userInfo]);

    // Get first description, because localizedDescription on Swift enum Error cannot be overriden
    NSString *description = [error description];
    if (description == nil) {
        description = [error localizedDescription];
    }

    NSString *localizedMessage = [NSString stringWithFormat:@"%@ (%@ %ld)", description, error.domain, (long)error.code];

    if (additionalText != nil) {
        localizedMessage = [NSString stringWithFormat:@"%@\n\n%@", localizedMessage, additionalText];
    }
    
    [ErrorHandler abortWithTitle:[BundleUtil localizedStringForKey:@"error_abort"] message:localizedMessage];
}

+ (void)abortWithTitle:(nonnull NSString *)title message:(nonnull NSString *)message {
    errorHandler = [ErrorHandler errorHandler];
    
    Class UIApplicationClass = NSClassFromString(@"UIApplication");
    if(!UIApplicationClass || ![UIApplicationClass respondsToSelector:@selector(sharedApplication)]) {
        return;
    }
    
    UIApplication *application = [UIApplication performSelector:@selector(sharedApplication)];
    if (application == nil) {
        return;
    } else if (application.windows.firstObject.rootViewController == nil) {
        UIViewController *dummyViewController = [[UIViewController alloc] init];
        application.windows.firstObject.rootViewController = dummyViewController;
    }
    
    [UIAlertTemplate showOKAlertWithOwner:application.windows.firstObject.rootViewController title:title message:message actionOk:^(UIAlertAction * _Nonnull action) {
        exit(0);
    }];
}

@end

¤ Diese beiden folgenden Angebotsgruppen bietet das Unternehmen0.1Angebot  (Wie Sie bei der Firma Beratungs- und Dienstleistungen beauftragen können 2026-11-04) ¤

*Eine klare Vorstellung vom Zielzustand






Wurzel

Suchen

PVS Prover

Isabelle Prover


Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.