Exception: Gcloud::Datastore::ApiError

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

Overview

Raised when an API call is not successful.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(method, response = nil) ⇒ ApiError

Returns a new instance of ApiError.



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

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.



34
35
36
# File 'lib/gcloud/datastore/errors.rb', line 34

def method
  @method
end

#responseObject (readonly)

The response object of the failed HTTP request.



38
39
40
# File 'lib/gcloud/datastore/errors.rb', line 38

def response
  @response
end