Exception: DingBot::Error::ResponseError

Inherits:
Error
  • Object
show all
Defined in:
lib/dingbot/error.rb

Overview

Custom error class for rescuing from HTTP response errors.

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ ResponseError

Returns a new instance of ResponseError.



17
18
19
20
# File 'lib/dingbot/error.rb', line 17

def initialize(response)
  @response = response
  super(build_error_message)
end

Instance Method Details

#response_statusInteger

Status code returned in the http response.

Returns:

  • (Integer)


25
26
27
# File 'lib/dingbot/error.rb', line 25

def response_status
  @response.code
end