Exception: Elementary::Errors::RPCFailure
- Inherits:
-
StandardError
- Object
- StandardError
- Elementary::Errors::RPCFailure
- Defined in:
- lib/elementary/errors.rb
Overview
A simple root class to signify an failure on the RPC server side (see
"rpc_failed 'message'")
Instance Attribute Summary collapse
-
#header_code ⇒ Object
readonly
Returns the value of attribute header_code.
-
#header_message ⇒ Object
readonly
Returns the value of attribute header_message.
-
#method ⇒ Object
readonly
Returns the value of attribute method.
-
#status_code ⇒ Object
readonly
Returns the value of attribute status_code.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ RPCFailure
constructor
A new instance of RPCFailure.
Constructor Details
#initialize(opts = {}) ⇒ RPCFailure
Returns a new instance of RPCFailure.
8 9 10 11 12 13 14 15 |
# File 'lib/elementary/errors.rb', line 8 def initialize(opts = {}) @status_code = opts.fetch(:status_code, nil) @method = opts.fetch(:method, "<Unknown Method>") @url = opts.fetch(:url, "<Unknown URL>") @header_code = opts.fetch(:header_code, "<Unknown Header Code>") @header_message = opts.fetch(:header_message, "<Unknown Header Message>") super "Error #{@header_code}: #{@header_message}" end |
Instance Attribute Details
#header_code ⇒ Object (readonly)
Returns the value of attribute header_code.
6 7 8 |
# File 'lib/elementary/errors.rb', line 6 def header_code @header_code end |
#header_message ⇒ Object (readonly)
Returns the value of attribute header_message.
6 7 8 |
# File 'lib/elementary/errors.rb', line 6 def @header_message end |
#method ⇒ Object (readonly)
Returns the value of attribute method.
6 7 8 |
# File 'lib/elementary/errors.rb', line 6 def method @method end |
#status_code ⇒ Object (readonly)
Returns the value of attribute status_code.
6 7 8 |
# File 'lib/elementary/errors.rb', line 6 def status_code @status_code end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
6 7 8 |
# File 'lib/elementary/errors.rb', line 6 def url @url end |