Exception: Wfirma::ApiError

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

Overview

A wFirma status code that aborts the request, and the answer a binary action (invoices/download) gives when it returns a JSON error instead of the file. Record-level outcomes flow into Result instead - see Status.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, status_code: nil, errors: []) ⇒ ApiError

Returns a new instance of ApiError.



13
14
15
16
17
# File 'lib/wfirma/errors.rb', line 13

def initialize(message, status_code: nil, errors: [])
  super(message)
  @status_code = status_code
  @errors = errors
end

Instance Attribute Details

#errorsObject (readonly)

Returns the value of attribute errors.



11
12
13
# File 'lib/wfirma/errors.rb', line 11

def errors
  @errors
end

#status_codeObject (readonly)

Returns the value of attribute status_code.



11
12
13
# File 'lib/wfirma/errors.rb', line 11

def status_code
  @status_code
end