Class: Google::Cloud::Spanner::Status

Inherits:
Object
  • Object
show all
Defined in:
lib/google/cloud/spanner/status.rb

Overview

Status

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

Examples:

require "google/cloud/spanner"

spanner = Google::Cloud::Spanner.new

job = spanner.create_database "my-instance",
                              "my-new-database"
job.wait_until_done!

if job.error?
  status = job.error
end

Instance Attribute Summary collapse

Instance Attribute Details

#codeInteger

The status code, which should be an enum value of google.rpc.Code.

Returns:

  • (Integer)

    the current value of code



51
52
53
# File 'lib/google/cloud/spanner/status.rb', line 51

def code
  @code
end

#descriptionString

The human-readable description for the status code, which should be an enum value of google.rpc.Code. For example, INVALID_ARGUMENT.

Returns:

  • (String)

    the current value of description



51
52
53
# File 'lib/google/cloud/spanner/status.rb', line 51

def description
  @description
end

#detailsArray?

A list of messages that carry the error details.

Returns:

  • (Array, nil)

    the current value of details



51
52
53
# File 'lib/google/cloud/spanner/status.rb', line 51

def details
  @details
end

#messageString

A developer-facing error message, which should be in English.

Returns:

  • (String)

    the current value of message



51
52
53
# File 'lib/google/cloud/spanner/status.rb', line 51

def message
  @message
end