Exception: MatrixSdk::MatrixRequestError
- Inherits:
-
MatrixError
- Object
- StandardError
- MatrixError
- MatrixSdk::MatrixRequestError
- Defined in:
- lib/matrix_sdk/errors.rb
Overview
An error specialized and raised for failed requests
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#httpstatus ⇒ Object
readonly
Returns the value of attribute httpstatus.
-
#message ⇒ Object
(also: #error)
readonly
Returns the value of attribute message.
Instance Method Summary collapse
-
#initialize(error, status) ⇒ MatrixRequestError
constructor
A new instance of MatrixRequestError.
- #to_s ⇒ Object
Constructor Details
#initialize(error, status) ⇒ MatrixRequestError
Returns a new instance of MatrixRequestError.
11 12 13 14 15 16 17 |
# File 'lib/matrix_sdk/errors.rb', line 11 def initialize(error, status) @code = error[:errcode] @httpstatus = status @message = error[:error] super error[:error] end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
8 9 10 |
# File 'lib/matrix_sdk/errors.rb', line 8 def code @code end |
#httpstatus ⇒ Object (readonly)
Returns the value of attribute httpstatus.
8 9 10 |
# File 'lib/matrix_sdk/errors.rb', line 8 def httpstatus @httpstatus end |
#message ⇒ Object (readonly) Also known as: error
Returns the value of attribute message.
8 9 10 |
# File 'lib/matrix_sdk/errors.rb', line 8 def @message end |
Instance Method Details
#to_s ⇒ Object
19 20 21 |
# File 'lib/matrix_sdk/errors.rb', line 19 def to_s "HTTP #{httpstatus} (#{code}): #{}" end |