OPError
@objc
public class OPError : NSError
Error class for all OloPay-pecific errors
Errors will come back as either Error or NSError instances. To get an instance of this class
just check that it is the correct type and cast to OPError.
func someMethod(error: Error?) {
if let opError = error as? OPError {
//Do something with the error
}
}
-
Domain for all OPError instances
Declaration
Swift
@objc public static let oloPayDomain: String -
Error type key for the
userInfoproperty. This can be used to access the error type, but theerrorTypeproperty exposes this information directlyDeclaration
Swift
@objc public static let errorTypeKey: String -
Card error type key for the
userInfoproperty. This can be used to access the card error type, but thecardErrorTypeproperty exposes this information directlyImportant
This key only exists in theuserInfodictionary if the error represents a card errorDeclaration
Swift
@objc public static let cardErrorTypeKey: String -
The type of error
Declaration
Swift
public var errorType: OPErrorType { get } -
If
errorTypeiscardError, this holds the type of error. For any other error type this isnilDeclaration
Swift
public var cardErrorType: OPCardErrorType? { get } -
If
errorTypeiscardError, this holds a user-friendly message that can be displayed to the user. For any other error type this isnilNote
This is a convenience property that is functionally equivalent to usinglocalizedDescriptionDeclaration
Swift
public var cardErrorMessage: String? { get }
OPError Class Reference