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

#code ⇒ Integer?

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

Returns:

  • (Integer, nil) —

    the first KSeF error code, when the body carried one



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

def code = problem&.code

#details ⇒ Array<String>

Returns flattened detail messages.

Returns:

  • (Array<String>) —

    flattened detail messages



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

def details = problem&.details || []

#raw ⇒ Object?

Returns the undecoded response body.

Returns:

  • (Object, nil) —

    the undecoded response body



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

def raw = problem&.raw

#status ⇒ Integer?

Returns HTTP status.

Returns:

  • (Integer, nil) —

    HTTP status



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

def status = problem&.status

#trace_id ⇒ String?

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

Returns:

  • (String, nil) —

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



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

def trace_id = problem&.trace_id