Method: Contentful::Management::Error#initialize

Defined in:
lib/contentful/management/error.rb

#initialize(response) ⇒ Error

Returns a new instance of Error.



10
11
12
13
14
15
16
17
18
# File 'lib/contentful/management/error.rb', line 10

def initialize(response)
  @response = response
  @error = {
    url: response.request.endpoint,
    message: response.error_message,
    details: response.raw.body.instance_variable_get(:@contents)
  }
  super best_available_message
end