pEpObjCAdapter/NSError+PEP+Internal.h
author Dirk Zimmermann <dz@pep.security>
Fri, 20 Sep 2019 10:01:48 +0200
branchIOSAD-141
changeset 1250 b6a4d30abd26
parent 902 32760267cd59
child 1287 b51665d2525c
permissions -rw-r--r--
IOSAD-141 Test for "hammering" the engine.
     1 //
     2 //  NSError+PEP+Internal.h
     3 //  pEpObjCAdapter
     4 //
     5 //  Created by Dirk Zimmermann on 28.02.19.
     6 //  Copyright © 2019 p≡p. All rights reserved.
     7 //
     8 
     9 #ifndef NSError_PEP_Internal_h
    10 #define NSError_PEP_Internal_h
    11 
    12 #import "PEPEngineTypes.h"
    13 
    14 /**
    15  Extension for creating `NSError`s from `PEP_STATUS`
    16  */
    17 @interface NSError (Internal)
    18 
    19 + (NSError * _Nonnull)errorWithPEPStatus:(PEPStatus)status
    20                                 userInfo:(NSDictionary<NSErrorUserInfoKey, id> * _Nonnull)dict;
    21 
    22 + (NSError * _Nonnull)errorWithPEPStatus:(PEPStatus)status;
    23 
    24 + (NSError * _Nonnull)errorWithPEPStatusInternal:(PEP_STATUS)status
    25                                         userInfo:(NSDictionary<NSErrorUserInfoKey, id> * _Nonnull)dict;
    26 
    27 + (NSError * _Nonnull)errorWithPEPStatusInternal:(PEP_STATUS)status;
    28 
    29 /**
    30  If the given status indicates an error, tries to set the given error accordingly.
    31  @return YES if the given status indicates an error condition, NO otherwise.
    32  */
    33 + (BOOL)setError:(NSError * _Nullable * _Nullable)error fromPEPStatusInternal:(PEP_STATUS)status;
    34 
    35 /**
    36  If the given status indicates an error, tries to set the given error accordingly.
    37  @return YES if the given status indicates an error condition, NO otherwise.
    38  */
    39 + (BOOL)setError:(NSError * _Nullable * _Nullable)error fromPEPStatus:(PEPStatus)status;
    40 
    41 @end
    42 
    43 #endif /* NSError_PEP_Internal_h */