Exception: SparkApi::ClientError
- Inherits:
-
StandardError
- Object
- StandardError
- SparkApi::ClientError
- Defined in:
- lib/spark_api/errors.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#details ⇒ Object
readonly
Returns the value of attribute details.
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#request_id ⇒ Object
readonly
Returns the value of attribute request_id.
-
#request_path ⇒ Object
readonly
Returns the value of attribute request_path.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ ClientError
constructor
A new instance of ClientError.
Constructor Details
#initialize(options = {}) ⇒ ClientError
Returns a new instance of ClientError.
25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/spark_api/errors.rb', line 25 def initialize ( = {}) # Support the standard initializer for errors opts = .is_a?(Hash) ? : {:message => .to_s} @code = opts[:code] @status = opts[:status] @details = opts[:details] @request_path = opts[:request_path] @request_id = opts[:request_id] @errors = opts[:errors] super(opts[:message]) end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
24 25 26 |
# File 'lib/spark_api/errors.rb', line 24 def code @code end |
#details ⇒ Object (readonly)
Returns the value of attribute details.
24 25 26 |
# File 'lib/spark_api/errors.rb', line 24 def details @details end |
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
24 25 26 |
# File 'lib/spark_api/errors.rb', line 24 def errors @errors end |
#request_id ⇒ Object (readonly)
Returns the value of attribute request_id.
24 25 26 |
# File 'lib/spark_api/errors.rb', line 24 def request_id @request_id end |
#request_path ⇒ Object (readonly)
Returns the value of attribute request_path.
24 25 26 |
# File 'lib/spark_api/errors.rb', line 24 def request_path @request_path end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
24 25 26 |
# File 'lib/spark_api/errors.rb', line 24 def status @status end |