class Greeve::ResponseError

HTTP response failed.

Attributes

code[R]

HTTP error code

status_message[R]

HTTP error message

Public Class Methods

new(opts = {}) click to toggle source

@option opts [Integer] :code HTTP error code @option opts [String] :status_message HTTP error message

# File lib/greeve/response_error.rb, line 11
def initialize(opts = {})
  @code = opts.fetch(:code).to_i
  @status_message = opts.fetch(:status_message).dup.freeze
end

Public Instance Methods

message() click to toggle source

@return [String] exception error message

# File lib/greeve/response_error.rb, line 17
def message
  "#{@code} #{@status_message}"
end