TKMError

public class TKMError : Error

TKMError is used to represent errors inside many of the SDK’s components. To retrieve more information about the type of exception, the result of errorCode must be inspected.

  • Returns the errors’s inner descriptor. The error descriptor contains the error’s actual properties, such as error message, error code and additional error data.

    Declaration

    Swift

    public let errorDescriptor: TKMErrorDescriptor

    Return Value

    the erros’s descriptor.

  • Returns the exception’s error message. This property returns TKMErrorDescriptor.errorMessage of the inner error descriptor.

    Declaration

    Swift

    public var message: String? { get }

    Return Value

    the error message.

  • Returns the exception’s error code. This property returns TKMErrorDescriptor.errorCode of the inner error descriptor.

    Declaration

    Swift

    public var errorCode: String { get }

    Return Value

    the error code.

  • Creates a TKMError with the given error code.

    Declaration

    Swift

    public init(errorCode: String)

    Parameters

    errorCode

    the error code of the TkException. Note that this constructor will create a TKMErrorDescriptor with this error code internally.

  • Creates a new TKMError with the given error descriptor.

    Declaration

    Swift

    public init(errorDescriptor: TKMErrorDescriptor)

    Parameters

    tkErrorDescriptor

    the TKMErrorDescriptor to be set for the TkException.