Exception: Ksef::Error
- Inherits:
-
StandardError
- Object
- StandardError
- Ksef::Error
- Defined in:
- lib/ksef/errors.rb
Overview
Base class for all KSeF gem errors.
Direct Known Subclasses
AuthError, ClientError, ConfigurationError, NotFoundError, RateLimitError, ServerError
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
The parsed error body returned by the API, when applicable.
-
#code ⇒ Object
readonly
The KSeF-specific exception code, when surfaced in the body.
-
#status ⇒ Object
readonly
The underlying HTTP status code, when applicable.
Instance Method Summary collapse
-
#initialize(message = nil, status: nil, body: nil, code: nil) ⇒ Error
constructor
A new instance of Error.
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( = nil, status: nil, body: nil, code: nil) super() @status = status @body = body @code = code end |
Instance Attribute Details
#body ⇒ Object (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 |
#code ⇒ Object (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 |
#status ⇒ Object (readonly)
The underlying HTTP status code, when applicable.
7 8 9 |
# File 'lib/ksef/errors.rb', line 7 def status @status end |