Exception: Dinie::UnknownWebhookEventError

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

Overview

A webhook signature verified, but the payload’s ‘type` is not in the openapi event catalog, so there is no per-type deserializer for it. Raising (rather than passing the raw event through) is deliberate — a new event `type` is a contract change. The unrecognized `type` is preserved on #event_type.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(event_type) ⇒ UnknownWebhookEventError

Returns a new instance of UnknownWebhookEventError.

Parameters:

  • event_type (String)


140
141
142
143
144
145
# File 'lib/dinie/runtime/errors.rb', line 140

def initialize(event_type)
  @event_type = event_type
  super("Unknown webhook event type: #{event_type.inspect}. It is not in the openapi event " \
        "catalog (generated/events). If Dinie added a new event type, the SDK must be updated " \
        "from the contract before it can deserialize this payload.")
end

Instance Attribute Details

#event_typeString (readonly)

Returns the unrecognized (but verified) webhook event ‘type`.

Returns:

  • (String)

    the unrecognized (but verified) webhook event ‘type`



137
138
139
# File 'lib/dinie/runtime/errors.rb', line 137

def event_type
  @event_type
end