Class: Miteru::StatusError

Inherits:
HTTP::Error
  • Object
show all
Defined in:
lib/miteru/errors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(msg, status_code, body) ⇒ StatusError

Returns a new instance of StatusError.

Parameters:

  • msg (String)
  • status_code (Integer)
  • body (String, nil)


26
27
28
29
30
31
# File 'lib/miteru/errors.rb', line 26

def initialize(msg, status_code, body)
  super(msg)

  @status_code = status_code
  @body = body
end

Instance Attribute Details

#bodyString? (readonly)

Returns:

  • (String, nil)


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

def body
  @body
end

#status_codeInteger (readonly)

Returns:

  • (Integer)


16
17
18
# File 'lib/miteru/errors.rb', line 16

def status_code
  @status_code
end

Instance Method Details

#detailObject



33
34
35
# File 'lib/miteru/errors.rb', line 33

def detail
  {status_code:, body:}
end