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
userInfo
property. This can be used to access the error type, but theerrorType
property exposes this information directlyDeclaration
Swift
@objc public static let errorTypeKey: String
-
Card error type key for the
userInfo
property. This can be used to access the card error type, but thecardErrorType
property exposes this information directlyImportant
This key only exists in theuserInfo
dictionary 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
errorType
iscardError
, this holds the type of error. For any other error type this isnil
Declaration
Swift
public var cardErrorType: OPCardErrorType? { get }
-
If
errorType
iscardError
, this holds a user-friendly message that can be displayed to the user. For any other error type this isnil
Note
This is a convenience property that is functionally equivalent to usinglocalizedDescription
Declaration
Swift
public var cardErrorMessage: String? { get }