Sha256: 161644523a292dde679b87cfee47af670a91243108a47b588645366c003c4928

Contents?: true

Size: 508 Bytes

Versions: 10

Compression:

Stored size: 508 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.to_s})" : ''
      response = @response ? "\nResponse: #{@response.to_s}" : ''
      "#{message}#{status}#{response}"
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
chartmogul-ruby-1.1.3 lib/chartmogul/errors/chartmogul_error.rb
chartmogul-ruby-1.1.1 lib/chartmogul/errors/chartmogul_error.rb
chartmogul-ruby-1.1.0 lib/chartmogul/errors/chartmogul_error.rb
chartmogul-ruby-1.0.2 lib/chartmogul/errors/chartmogul_error.rb
chartmogul-ruby-1.0.1 lib/chartmogul/errors/chartmogul_error.rb
chartmogul-ruby-1.0.0 lib/chartmogul/errors/chartmogul_error.rb
chartmogul-ruby-0.1.4 lib/chartmogul/errors/chartmogul_error.rb
chartmogul-ruby-0.1.3 lib/chartmogul/errors/chartmogul_error.rb
chartmogul-ruby-0.1.2 lib/chartmogul/errors/chartmogul_error.rb
chartmogul-ruby-0.1.1 lib/chartmogul/errors/chartmogul_error.rb