HYPError
@interface HYPError
This class works as a container for error information. This class is
extensively used by the SDK, especially in delegates. It holds four
main properties: a code, a description, a reason for the error, and
a recovery suggestion. Error codes are listed under HYPErrorCode
,
along with their meaning. The description indicates what went wrong,
such as Couldn’t send a message
. The reason indicates the cause, such
as Bluetooth is not turned on
. Continuing on the same example, the
recovery suggestion indicates a possible recovery from the error, such
as Try turning Bluetooth on
.
-
This property indicates the error code, as listed by the
HYPErrorCode
enumeration.Declaration
Objective-C
@property (readonly, atomic) int code;
Swift
var code: HYPError! { get }
-
This property provides a description of the error, indicating what went wrong. An example could be
Could not send a message
.Declaration
Objective-C
@property (readonly, atomic) int *description;
Swift
var description: UnsafeMutablePointer<Int32>! { get }
-
This property gives a reason for the failure. An example could be
The Bluetooth adapter is turned off
.Declaration
Objective-C
@property (readonly, atomic) int *reason;
Swift
var reason: UnsafeMutablePointer<Int32>! { get }
-
This property provides a recovery suggestion that could help in fixing the problem that caused the error. An example could be
Try turning Bluetooth on
.Declaration
Objective-C
@property (readonly, atomic) int *suggestion;
Swift
var suggestion: UnsafeMutablePointer<Int32>! { get }
-
Initializes a HYPError instance.
Declaration
Objective-C
- (instancetype)initWithCode:(id)code description:(id)description reason:(id)reason suggestion:(id)suggestion;
Swift
init!(code: Any!, description: Any!, reason: Any!, suggestion: Any!)
Parameters
code
The error code.
description
An error description.
reason
A cause for the error.
suggestion
A recovery suggestion.