VOError

@interface VOError : NSObject

VOError will be returned inside the userInfo of an NSError on errors from the VouchrServer when using the VONetworkManager to make network calls.

It can be accessed from the NSError:

VOError *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 VOErrorCode for a list of values.

    Declaration

    Objective-C

    @property (readonly, nonatomic) VOErrorCode code;

    Swift

    var code: VOErrorCode { get }
  • Initializer for VOError 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 VOError.

  • Static Initializer for VOError with a dictionary returned from the Vouchr Server.

    Declaration

    Objective-C

    + (nonnull VOError *)errorWithDictionary:(nonnull NSDictionary *)dictionary;

    Parameters

    dictionary

    - The data returned from the Vouchr Server.

    Return Value

    Instance of VOError.

  • 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.