Exception: Hooksmith::MultipleProcessorsError
- Defined in:
- lib/hooksmith/errors.rb
Overview
Raised when multiple processors can handle the same event.
This error is raised when more than one processor's can_handle?
method returns true for the same webhook event. Hooksmith enforces
exactly-one processor semantics.
This error intentionally does not include the full payload in the message to prevent PII exposure in logs and error tracking systems.
Instance Attribute Summary collapse
-
#payload_size ⇒ Integer
readonly
The number of bytes in the payload (for debugging).
-
#processor_names ⇒ Array<String>
readonly
The names of the matching processor classes.
Attributes inherited from Error
Instance Method Summary collapse
-
#initialize(provider, event, payload, processor_names: []) ⇒ MultipleProcessorsError
constructor
Initializes the error with details about the provider and event.
Constructor Details
#initialize(provider, event, payload, processor_names: []) ⇒ MultipleProcessorsError
Initializes the error with details about the provider and event.
107 108 109 110 111 112 113 114 115 |
# File 'lib/hooksmith/errors.rb', line 107 def initialize(provider, event, payload, processor_names: []) @payload_size = payload.to_s.bytesize @processor_names = processor_names super( "Multiple processors found for #{provider} event #{event} (payload_size=#{@payload_size} bytes)", provider:, event: ) end |
Instance Attribute Details
#payload_size ⇒ Integer (readonly)
Returns the number of bytes in the payload (for debugging).
97 98 99 |
# File 'lib/hooksmith/errors.rb', line 97 def payload_size @payload_size end |
#processor_names ⇒ Array<String> (readonly)
Returns the names of the matching processor classes.
99 100 101 |
# File 'lib/hooksmith/errors.rb', line 99 def processor_names @processor_names end |