Sha256: 1f501b1c7e7f420bde2b06401bd7175b4a8201274a2168a135c4b2dd1a469be7

Contents?: true

Size: 507 Bytes

Versions: 4

Compression:

Stored size: 507 Bytes

Contents

module Peakium
  class PeakiumError < StandardError
    attr_reader :message
    attr_reader :http_status
    attr_reader :http_body
    attr_reader :json_body

    def initialize(message=nil, http_status=nil, http_body=nil, json_body=nil)
      @message = message
      @http_status = http_status
      @http_body = http_body
      @json_body = json_body
    end

    def to_s
      status_string = @http_status.nil? ? "" : "(Status #{@http_status}) "
      "#{status_string}#{@message}"
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
peakium-0.1.4 lib/peakium/errors/peakium_error.rb
peakium-0.1.3 lib/peakium/errors/peakium_error.rb
peakium-0.1.2 lib/peakium/errors/peakium_error.rb
peakium-0.1.1 lib/peakium/errors/peakium_error.rb