Sha256: 02e769db9b79715f558f56f3cf2936b5defd6754da14c943282315b0a8d8e5e6
Contents?: true
Size: 731 Bytes
Versions: 1
Compression:
Stored size: 731 Bytes
Contents
# frozen_string_literal: true module Tikkie module Api # Generic Tikkie Exception. class Exception < StandardError end # Exception when an HTTP request fails. class RequestError < Tikkie::Api::Exception attr_accessor :response def initialize(response) @response = response end def errors response.errors end def request_uri response.request_uri end def http_code response.http_code end def http_message response.http_message end def messages errors.map(&:message) end def to_s "#{http_code} #{http_message}: #{messages.join(', ')}" end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
tikkie-api-2.0.0 | lib/tikkie/api/exception.rb |