Sha256: e8a4c5b074eeb33c1c6ca279d3a224900b92fe5b52f07b652905e642f8861300

Contents?: true

Size: 517 Bytes

Versions: 4

Compression:

Stored size: 517 Bytes

Contents

module Screenbeacon
  class ScreenbeaconError < 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
screenbeacon-1.0.2 lib/screenbeacon/errors/screenbeacon_error.rb
screenbeacon-1.0.1 lib/screenbeacon/errors/screenbeacon_error.rb
screenbeacon-1.0.0 lib/screenbeacon/errors/screenbeacon_error.rb
screenbeacon-0.1.0 lib/screenbeacon/errors/screenbeacon_error.rb