Exception: JabberAdmin::Error
- Inherits:
-
StandardError
- Object
- StandardError
- JabberAdmin::Error
- Defined in:
- lib/jabber_admin/errors.rb
Overview
The base exception which all other exceptions inherit. In case you want to use our error handling with the bang variants, you can rescue all exceptions like this:
begin
JabberAdmin.COMMAND!
rescue JabberAdmin::Error => err
# Do your error handling here
end
Direct Known Subclasses
Instance Attribute Summary collapse
-
#response ⇒ Object
Returns the value of attribute response.
Instance Method Summary collapse
-
#initialize(msg, response = nil) ⇒ Error
constructor
Create a new exception.
Constructor Details
#initialize(msg, response = nil) ⇒ Error
Create a new exception.
20 21 22 23 24 |
# File 'lib/jabber_admin/errors.rb', line 20 def initialize(msg, response = nil) @response = response msg += " => #{response.body}" if response&.body super(msg) end |
Instance Attribute Details
#response ⇒ Object
Returns the value of attribute response.
14 15 16 |
# File 'lib/jabber_admin/errors.rb', line 14 def response @response end |