Exception: MatrixSdk::MatrixRequestError

Inherits:
MatrixError show all
Defined in:
lib/matrix_sdk/errors.rb

Overview

An error specialized and raised for failed requests

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#codeObject (readonly)

Returns the value of attribute code.



8
9
10
# File 'lib/matrix_sdk/errors.rb', line 8

def code
  @code
end

#httpstatusObject (readonly)

Returns the value of attribute httpstatus.



8
9
10
# File 'lib/matrix_sdk/errors.rb', line 8

def httpstatus
  @httpstatus
end

#messageObject (readonly) Also known as: error

Returns the value of attribute message.



8
9
10
# File 'lib/matrix_sdk/errors.rb', line 8

def message
  @message
end

Instance Method Details

#to_sObject



19
20
21
# File 'lib/matrix_sdk/errors.rb', line 19

def to_s
  "HTTP #{httpstatus} (#{code}): #{message}"
end