Sha256: 8c1e6b9a9b654bd213dbdcfb2ce9e571ee900080c963f54b2712f6f027bf29c2
Contents?: true
Size: 447 Bytes
Versions: 12
Compression:
Stored size: 447 Bytes
Contents
# frozen_string_literal: true module Dato class ApiError < StandardError attr_reader :response def initialize(response) @response = response end def message [ 'DatoCMS API Error', "Status: #{response[:status]}", 'Response:', JSON.pretty_generate(body) ].join("\n") end def body if response[:body] JSON.parse(response[:body]) end end end end
Version data entries
12 entries across 12 versions & 1 rubygems