Exception: Clickwrap::CaptureRefused

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

Overview

The family of refusals a PERSON can cause from a form: a stale or missing presentation, a submission that doesn't parse, a required box left empty. These are not application errors — they deserve a re-rendered form with a localized sentence, never a 500. One rescue covers the whole family:

rescue Clickwrap::CaptureRefused => refusal
redirect_to somewhere_path, alert: refusal.user_facing_message

Everything OUTSIDE this family (an evidence write failure above all) stays loud on purpose: infrastructure problems are yours to see, not the person's to absorb.

Instance Method Summary collapse

Instance Method Details

#user_facing_messageObject

The localized sentence the gem's own screens show for this refusal — safe to put in front of a person, never a developer-facing message.



50
51
52
# File 'lib/clickwrap/errors.rb', line 50

def user_facing_message
  I18n.t("clickwrap.errors.presentation_no_longer_valid")
end