Exception: Gcloud::Datastore::ApiError

Inherits:
Error
  • Object
show all
Defined in:
lib/gcloud/datastore/errors.rb

Overview

# ApiError

Raised when an API call is not successful.

Instance Attribute Summary collapse

Attributes inherited from Error

#inner

Instance Method Summary collapse

Methods inherited from Error

from_error, klass_for

Constructor Details

#initialize(method, response = nil) ⇒ ApiError

Returns a new instance of ApiError.



48
49
50
51
52
# File 'lib/gcloud/datastore/errors.rb', line 48

def initialize method, response = nil
  super("API call to #{method} was not successful")
  @method = method
  @response = response
end

Instance Attribute Details

#methodObject (readonly)

The API method of the failed HTTP request.



41
42
43
# File 'lib/gcloud/datastore/errors.rb', line 41

def method
  @method
end

#responseObject (readonly)

The response object of the failed HTTP request.



45
46
47
# File 'lib/gcloud/datastore/errors.rb', line 45

def response
  @response
end