RVS_Fault

public struct RVS_Fault : Error

This is a struct that describes an error/issue.

The enclosed enums are the standard ONVIF error codes and subcodes. They use ONVIF TitleCase, as opposed to the standard camelCase, in order to help correlate.

Public Embedded Enums

  • The main fault codes (env namespace)

    See more

    Declaration

    Swift

    public enum FaultCode : Error
  • Sender and Receiver subcodes (per namespace)

    See more

    Declaration

    Swift

    public enum Subcode : String, Error

Public Constant Properties

  • This is any HTTP code that may have accompanied the error. Default is 0.

    Declaration

    Swift

    public let httpCode: Int
  • This is a partially-parsed ONVIF response. If this is specified, the the fault code will be dynamically determined.

    Declaration

    Swift

    public let responseDictionary: [String : Any]!

Public Calculated Properties

  • This is any ONVIF fault. The dictionary is parsed. READ-ONLY.

    Declaration

    Swift

    public var fault: FaultCode { get }
  • This returns any reason or details text (may be empty).

    Declaration

    Swift

    public var reason: String { get }
  • This returns the main fault localized description.

    Declaration

    Swift

    public var localizedDescription: String { get }

Public Initializer

  • This initializer will fail if there is no actual fault in the data.

    Both parameters are optional.

    Declaration

    Swift

    public init?(faultCode inFaultCode: FaultCode! = nil, faultDictionary inFaultDictionary: [String : Any]! = nil, httpCode inHTTPCode: Int = 0)

    Parameters

    faultCode

    This is a prearranged fault. If this is provided, then the next two are ignored.

    faultDictionary

    This is the Dictionary that has been partially parsed, but is “top-level” (above “Body”). Default is nil.

    httpCode

    This is any HTTP code that accompanies the fault. Default is 0 (undefined).

    Return Value

    nil, if there is no fault.