class Google::Cloud::Bigtable::Status

# Status

Represents a logical error model from the Bigtable service, containing an error code, an error message, and optional error details.

@attr [Integer] code The status code, which should be an enum value of

[google.rpc.Code](https://github.com/googleapis/googleapis/blob/master/google/rpc/code.proto).

@attr [String] description The human-readable description for the status code, which should be an enum value of

[google.rpc.Code](https://github.com/googleapis/googleapis/blob/master/google/rpc/code.proto). For example,
`INVALID_ARGUMENT`.

@attr [String] message A developer-facing error message, which should be in English. @attr [Array<String>] details A list of messages that carry the error details.

@example

require "google/cloud/bigtable"

bigtable = Google::Cloud::Bigtable.new

table = bigtable.table "my-instance", "my-table"

entries = []
entries << table.new_mutation_entry("row-1").set_cell("cf1", "field1", "XYZ")
entries << table.new_mutation_entry("row-2").set_cell("cf1", "field1", "ABC")
responses = table.mutate_rows entries

responses.each do |response|
  puts response.status.description
end

Attributes

code[R]
description[R]
details[R]
message[R]

Public Class Methods

description_for(code) click to toggle source

@private Get a descriptive symbol for a google.rpc.Code integer

# File lib/google/cloud/bigtable/status.rb, line 71
def self.description_for code
  ["OK", "CANCELLED", "UNKNOWN", "INVALID_ARGUMENT", "DEADLINE_EXCEEDED", "NOT_FOUND", "ALREADY_EXISTS",
   "PERMISSION_DENIED", "RESOURCE_EXHAUSTED", "FAILED_PRECONDITION", "ABORTED", "OUT_OF_RANGE", "UNIMPLEMENTED",
   "INTERNAL", "UNAVAILABLE", "DATA_LOSS", "UNAUTHENTICATED"][code]
end
from_grpc(grpc) click to toggle source

@private New Status from a Google::Rpc::Status object.

# File lib/google/cloud/bigtable/status.rb, line 66
def self.from_grpc grpc
  new grpc.code, description_for(grpc.code), grpc.message, grpc.details
end
new(code, description, message, details) click to toggle source

@private Creates a Status object.

# File lib/google/cloud/bigtable/status.rb, line 57
def initialize code, description, message, details
  @code = code
  @description = description
  @message = message
  @details = details
end