Exception: Ksef::Error

Inherits:
StandardError
  • Object
show all
Defined in:
lib/ksef/errors.rb

Overview

Base class for all KSeF gem errors.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message = nil, status: nil, body: nil, code: nil) ⇒ Error

Returns a new instance of Error.



15
16
17
18
19
20
# File 'lib/ksef/errors.rb', line 15

def initialize(message = nil, status: nil, body: nil, code: nil)
  super(message)
  @status = status
  @body = body
  @code = code
end

Instance Attribute Details

#bodyObject (readonly)

The parsed error body returned by the API, when applicable.



10
11
12
# File 'lib/ksef/errors.rb', line 10

def body
  @body
end

#codeObject (readonly)

The KSeF-specific exception code, when surfaced in the body.



13
14
15
# File 'lib/ksef/errors.rb', line 13

def code
  @code
end

#statusObject (readonly)

The underlying HTTP status code, when applicable.



7
8
9
# File 'lib/ksef/errors.rb', line 7

def status
  @status
end