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