class Dato::ApiError

Attributes

body[R]
response[R]

Public Class Methods

new(response) click to toggle source
Calls superclass method
# File lib/dato/api_error.rb, line 7
def initialize(response)
  body = JSON.parse(response[:body]) if response[:body]

  message = [
    "DatoCMS API Error",
    "Status: #{response[:status]}",
    "Response:",
    JSON.pretty_generate(body),
  ].join("\n")

  super(message)

  @response = response
  @body = body
end