Code

enum Code
extension HomeError.Code : Equatable, Hashable, RawRepresentable, Sendable

Error codes thrown by the GoogleHomeSDK.

Consistent with gRPC status codes: https://grpc.io/docs/guides/status-codes/

  • The operation was cancelled (typically by the caller).

    Declaration

    Swift

    case cancelled
  • Unknown error. An example of where this error may be returned is if a Status value received from another address space belongs to an error space that is not recognized in this address space. Also errors raised by APIs that do not return enough error information may be converted to this error.

    Declaration

    Swift

    case unknown
  • Client specified an invalid argument. Note that this differs from FAILED_PRECONDITION. INVALID_ARGUMENT indicates arguments that are problematic regardless of the state of the system (e.g., a malformed file name).

    Declaration

    Swift

    case invalidArgument
  • Deadline expired before operation could complete. For operations that change the state of the system, this error may be returned even if the operation has completed successfully. For example, a successful response from a server could have been delayed long enough for the deadline to expire.

    Declaration

    Swift

    case deadlineExceeded
  • Some requested entity (e.g., file or directory) was not found.

    Declaration

    Swift

    case notFound
  • The entity that a client attempted to create (e.g., file or directory) already exists.

    Declaration

    Swift

    case alreadyExists
  • The caller does not have permission to execute the specified operation. PERMISSION_DENIED must not be used for rejections caused by exhausting some resource (use RESOURCE_EXHAUSTED instead for those errors). PERMISSION_DENIED must not be used if the caller can not be identified (use UNAUTHENTICATED instead for those errors).

    Declaration

    Swift

    case permissionDenied
  • Some resource has been exhausted, perhaps a per-user quota, or perhaps the entire file system is out of space.

    Declaration

    Swift

    case resourceExhausted
  • Operation was rejected because the system is not in a state required for the operation’s execution. For example, directory to be deleted may be non-empty, an rmdir operation is applied to a non-directory, etc.

    A litmus test that may help a service implementor in deciding between FAILED_PRECONDITION and UNAVAILABLE: (a) If the client can retry just the failing call, it should be UNAVAILABLE. (b) If the client should retry at a higher-level (e.g., restarting a read-only session or transaction), FAILED_PRECONDITION should be returned.

    Declaration

    Swift

    case failedPrecondition
  • The operation was aborted, typically due to a concurrency issue such as a sequencer check failure or transaction abort.

    See the guidelines above for deciding between FAILED_PRECONDITION and ABORTED.

    Declaration

    Swift

    case aborted
  • The operation was attempted past the valid range. E.g., seeking or reading past end of file.

    Unlike INVALID_ARGUMENT, this error indicates a problem that may be fixed if the system state changes. For example, a 32-bit file system will generate OUT_OF_RANGE if an attempt is made to write a file that is larger than the system is capable of supporting.

    OUT_OF_RANGE must not be used for errors arising from attempting to read from an empty file, or to seek past EOF.

    Declaration

    Swift

    case outOfRange
  • The operation is not implemented or is not supported/enabled in this service.

    Declaration

    Swift

    case unimplemented
  • Internal errors. This means that some invariants expected by the underlying system have been broken. This error code is reserved for serious errors.

    Declaration

    Swift

    case `internal`
  • The service is currently unavailable. This is most likely a transient condition, which can be corrected by retrying with a backoff.

    See the guidelines above for deciding between FAILED_PRECONDITION and UNAVAILABLE.

    Declaration

    Swift

    case unavailable
  • Unrecoverable data loss or corruption.

    Declaration

    Swift

    case dataLoss
  • The user is not authenticated.

    Declaration

    Swift

    case unauthenticated
  • Creates a new instance with the specified raw value.

    If there is no value of the type that corresponds with the specified raw value, this initializer returns nil. For example:

    enum PaperSize: String {
        case A4, A5, Letter, Legal
    }
    
    print(PaperSize(rawValue: "Legal"))
    // Prints "Optional("PaperSize.Legal")"
    
    print(PaperSize(rawValue: "Tabloid"))
    // Prints "nil"
    

    Declaration

    Swift

    init?(rawValue: Int)

    Parameters

    rawValue

    The raw value to use for the new instance.