Exception: BrocadeAPIClient::BrocadeException
- Inherits:
-
StandardError
- Object
- StandardError
- BrocadeAPIClient::BrocadeException
- Defined in:
- lib/BrocadeAPIClient/exceptions.rb
Overview
Brocade Exception Classes
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#http_status ⇒ Object
readonly
Returns the value of attribute http_status.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#ref ⇒ Object
readonly
Returns the value of attribute ref.
Instance Method Summary collapse
-
#initialize(code: nil, message: nil, ref: nil, http_status: nil) ⇒ BrocadeException
constructor
A new instance of BrocadeException.
Constructor Details
#initialize(code: nil, message: nil, ref: nil, http_status: nil) ⇒ BrocadeException
Returns a new instance of BrocadeException.
15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/BrocadeAPIClient/exceptions.rb', line 15 def initialize(code: nil, message: nil, ref: nil, http_status: nil) @code = code @message = @ref = ref @http_status = http_status formatted_string = 'Error: ' formatted_string += format(' (HTTP %s)', @http_status) if @http_status formatted_string += format(' API code: %s', @code) if @code formatted_string += format(' - %s', @message) if @message formatted_string += format(' - %s', @ref) if @ref super(formatted_string) end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
14 15 16 |
# File 'lib/BrocadeAPIClient/exceptions.rb', line 14 def code @code end |
#http_status ⇒ Object (readonly)
Returns the value of attribute http_status.
14 15 16 |
# File 'lib/BrocadeAPIClient/exceptions.rb', line 14 def http_status @http_status end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
14 15 16 |
# File 'lib/BrocadeAPIClient/exceptions.rb', line 14 def @message end |
#ref ⇒ Object (readonly)
Returns the value of attribute ref.
14 15 16 |
# File 'lib/BrocadeAPIClient/exceptions.rb', line 14 def ref @ref end |