Sha256: 251648971daa28137ec57a1c213046cacfe820f519466fb5b904c29153ee0458

Contents?: true

Size: 519 Bytes

Versions: 1

Compression:

Stored size: 519 Bytes

Contents

module ChartMogul
  class ChartMogulError < StandardError
    attr_accessor :message
    attr_accessor :response
    attr_accessor :http_status

    def initialize(message, http_status: nil, response: nil)
      @message = message
      @http_status = http_status
      @response = response
    end

    def to_s
      status = @http_status ? " (HTTP Status: #{@http_status})" : ''
      response = @response ? "\nResponse: #{@response}" : ''
      "#{message}#{status}#{response}"
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
chartmogul-ruby-1.1.5 lib/chartmogul/errors/chartmogul_error.rb