VouchrError
@interface VouchrError : NSObject
VouchrError
will be returned inside the userInfo of an NSError on errors
from the VouchrServer when using the NetworkManager
to make network calls.
It can be accessed from the NSError:
VouchrError *vouchrError = error.userInfo[@"message"];
-
The data of the error message. Will contain info specifically related to each network call.
Declaration
Objective-C
@property (readonly, strong, nonatomic, nullable) NSMutableDictionary *data;
Swift
var data: NSMutableDictionary? { get }
-
Vouchr internal error code associated with the error. See
VouchrErrorCode
for a list of values.Declaration
Objective-C
@property (readonly, nonatomic) VouchrErrorCode code;
Swift
var code: VouchrErrorCode { get }
-
Initializer for
VouchrError
with a dictionary returned from the Vouchr Server.Declaration
Objective-C
- (nonnull instancetype)initWithDictionary:(nonnull NSDictionary *)dictionary;
Swift
init(dictionary: [AnyHashable : Any])
Parameters
dictionary
- The data returned from the Vouchr Server.
Return Value
Instance of
VouchrError
. -
Static Initializer for
VouchrError
with a dictionary returned from the Vouchr Server.Declaration
Objective-C
+ (nonnull VouchrError *)errorWithDictionary:(nonnull NSDictionary *)dictionary;
Parameters
dictionary
- The data returned from the Vouchr Server.
Return Value
Instance of
VouchrError
. -
Declaration
Objective-C
- (nullable NSString *)message;
Swift
func message() -> String?
Return Value
the message string of the error.
-
Declaration
Objective-C
- (nullable NSArray<NSDictionary *> *)errorFields;
Swift
func errorFields() -> [[AnyHashable : Any]]?
Return Value
a list of error fields for the error.