# Cloud Spanner API - Class Google::Cloud::Spanner::Status (v2.36.0)

2.36.0 (latest) 2.35.0 2.34.0 2.33.0 2.32.0 2.31.0 2.30.0 2.29.0 2.28.0 2.27.0 2.26.0 2.25.0 2.24.0 2.23.0 2.22.0 2.21.0 2.20.0 2.19.1 2.18.1 2.17.0 2.16.1 2.15.0 2.14.0 2.13.0 2.12.1 2.11.0 Reference documentation and code samples for the Cloud Spanner API class Google::Cloud::Spanner::Status.

## Status

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

## Inherits

- Object

## Example

```ruby
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
```

## Methods

### #code

    def code() -> Integer

The status code, which should be an enum value of
[google.rpc.Code](https://github.com/googleapis/googleapis/blob/master/google/rpc/code.proto).
**Returns**

- (Integer) --- the current value of code

### #code=

    def code=(value) -> Integer

The status code, which should be an enum value of
[google.rpc.Code](https://github.com/googleapis/googleapis/blob/master/google/rpc/code.proto).
**Parameter**

- **value** (Integer) --- the newly set value
**Returns**

- (Integer) --- the newly set value

### #description

    def description() -> String

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`.
**Returns**

- (String) --- the current value of description

### #description=

    def description=(value) -> String

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`.
**Parameter**

- **value** (String) --- the newly set value
**Returns**

- (String) --- the newly set value

### #details

    def details() -> Array, nil

A list of messages that carry the error
details.
**Returns**

- (Array, nil) --- the current value of details

### #details=

    def details=(value) -> Array, nil

A list of messages that carry the error
details.
**Parameter**

- **value** (Array, nil) --- the newly set value
**Returns**

- (Array, nil) --- the newly set value

### #message

    def message() -> String

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

- (String) --- the current value of message

### #message=

    def message=(value) -> String

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

- **value** (String) --- the newly set value
**Returns**

- (String) --- the newly set value