Exception: Belvo::RequestError

Inherits:
BelvoAPIError show all
Defined in:
lib/belvo/exceptions.rb

Overview

Generic request error, any response with status different than 2xx.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, status_code, detail) ⇒ RequestError

Returns a new instance of RequestError.

Parameters:

  • message (String)

    Error short description

  • status_code (Integer)

    HTTP code

  • detail (JSON)

    Detailed error(s) description



25
26
27
28
29
# File 'lib/belvo/exceptions.rb', line 25

def initialize(message, status_code, detail)
  super(message)
  @status_code = status_code
  @detail = detail
end

Instance Attribute Details

#detailJSON (readonly)

Error message returned by Belvo API

Returns:

  • (JSON)


20
21
22
# File 'lib/belvo/exceptions.rb', line 20

def detail
  @detail
end

#status_codeInteger (readonly)

HTTP code returned by Belvo API

Returns:

  • (Integer)


16
17
18
# File 'lib/belvo/exceptions.rb', line 16

def status_code
  @status_code
end