Exception: Ksef::ApiError

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

Overview

Any error response from the KSeF API.

Instance Attribute Summary

Attributes inherited from Error

#problem

Instance Method Summary collapse

Methods inherited from Error

#initialize

Constructor Details

This class inherits a constructor from Ksef::Error

Instance Method Details

#codeInteger?

Returns the first KSeF error code, when the body carried one.

Returns:

  • (Integer, nil)

    the first KSeF error code, when the body carried one



38
# File 'lib/ksef/errors.rb', line 38

def code = problem&.code

#detailsArray<String>

Returns flattened detail messages.

Returns:

  • (Array<String>)

    flattened detail messages



41
# File 'lib/ksef/errors.rb', line 41

def details = problem&.details || []

#rawObject?

Returns the undecoded response body.

Returns:

  • (Object, nil)

    the undecoded response body



47
# File 'lib/ksef/errors.rb', line 47

def raw = problem&.raw

#statusInteger?

Returns HTTP status.

Returns:

  • (Integer, nil)

    HTTP status



35
# File 'lib/ksef/errors.rb', line 35

def status = problem&.status

#trace_idString?

Returns the Ministry's correlation id — quote this in support requests.

Returns:

  • (String, nil)

    the Ministry's correlation id — quote this in support requests



44
# File 'lib/ksef/errors.rb', line 44

def trace_id = problem&.trace_id