Exception: Anypost::WebhookVerificationError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/anypost/webhook_signature.rb

Overview

Raised when a webhook delivery’s signature cannot be verified.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, reason) ⇒ WebhookVerificationError

Returns a new instance of WebhookVerificationError.



17
18
19
20
# File 'lib/anypost/webhook_signature.rb', line 17

def initialize(message, reason)
  super(message)
  @reason = reason
end

Instance Attribute Details

#reasonSymbol (readonly)

The machine-readable reason. Branch on this rather than the message.

One of: :malformed_header, :no_timestamp, :no_signatures, :timestamp_out_of_tolerance, :no_match.

Returns:

  • (Symbol)


15
16
17
# File 'lib/anypost/webhook_signature.rb', line 15

def reason
  @reason
end