Exception: Dinie::APIError
- Defined in:
- lib/dinie/runtime/errors.rb,
sig/dinie/runtime/errors.rbs
Overview
Base for everything that originates from talking to the Dinie API. code / request_id
are first-class on every API error.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#code ⇒ String?
readonly
Machine-readable error code from the Problem Details
codeextension. -
#request_id ⇒ String?
readonly
Per-request correlation id (from
x-request-id, body fallback).
Instance Method Summary collapse
-
#initialize(message = nil, code: nil, request_id: nil) ⇒ APIError
constructor
A new instance of APIError.
Constructor Details
#initialize(message = nil, code: nil, request_id: nil) ⇒ APIError
Returns a new instance of APIError.
26 27 28 29 30 |
# File 'lib/dinie/runtime/errors.rb', line 26 def initialize( = nil, code: nil, request_id: nil) super() @code = code @request_id = request_id end |
Instance Attribute Details
#code ⇒ String? (readonly)
Returns machine-readable error code from the Problem Details code extension.
18 19 20 |
# File 'lib/dinie/runtime/errors.rb', line 18 def code @code end |
#request_id ⇒ String? (readonly)
Returns per-request correlation id (from x-request-id, body fallback).
21 22 23 |
# File 'lib/dinie/runtime/errors.rb', line 21 def request_id @request_id end |