Sha256: ab4004ef14314351279748673b564b010fc2a692d3d7411927cb67c4978fb706

Contents?: true

Size: 507 Bytes

Versions: 11

Compression:

Stored size: 507 Bytes

Contents

module Octobat
  class OctobatError < 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

11 entries across 11 versions & 1 rubygems

Version Path
octobat-0.0.12 lib/octobat/errors/octobat_error.rb
octobat-0.0.11 lib/octobat/errors/octobat_error.rb
octobat-0.0.10 lib/octobat/errors/octobat_error.rb
octobat-0.0.9 lib/octobat/errors/octobat_error.rb
octobat-0.0.8 lib/octobat/errors/octobat_error.rb
octobat-0.0.7 lib/octobat/errors/octobat_error.rb
octobat-0.0.6 lib/octobat/errors/octobat_error.rb
octobat-0.0.5 lib/octobat/errors/octobat_error.rb
octobat-0.0.4 lib/octobat/errors/octobat_error.rb
octobat-0.0.3 lib/octobat/errors/octobat_error.rb
octobat-0.0.2 lib/octobat/errors/octobat_error.rb