Exception: HipChat::ServiceError
- Inherits:
-
StandardError
- Object
- StandardError
- HipChat::ServiceError
- Defined in:
- lib/hipchat/errors.rb
Direct Known Subclasses
BadRequest, InvalidApiVersion, InvalidEvent, InvalidUrl, MethodNotAllowed, RoomMissingOwnerUserId, RoomNameTooLong, UnknownResponseCode, UsernameTooLong
Instance Attribute Summary collapse
-
#response ⇒ Object
Returns the value of attribute response.
Instance Method Summary collapse
-
#initialize(msg, response: nil) ⇒ ServiceError
constructor
A new instance of ServiceError.
- #message ⇒ Object
Constructor Details
#initialize(msg, response: nil) ⇒ ServiceError
Returns a new instance of ServiceError.
5 6 7 8 |
# File 'lib/hipchat/errors.rb', line 5 def initialize(msg, response: nil) @response = response @msg = msg end |
Instance Attribute Details
#response ⇒ Object
Returns the value of attribute response.
3 4 5 |
# File 'lib/hipchat/errors.rb', line 3 def response @response end |
Instance Method Details
#message ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/hipchat/errors.rb', line 10 def if @response.respond_to? :body "#{@msg}:\nResponse: #{@response.body}" else @msg end end |