Exception: Moderate::ConfigurationError

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

Overview

Raised by Configuration#validate! (called at the end of Moderate.configure) when the initializer block contains a bad value — an unknown filter mode, an unregistered adapter name, a blank user_class, etc.

We deliberately also raise plain ArgumentError from the validating setters themselves (per docs/configuration.md: "raises a plain-English ArgumentError immediately"), so a typo fails fast at the assignment line. ConfigurationError exists for the cases where validation can only run once the whole block is known (e.g. a :block-mode filter pointed at an async adapter, which needs both the mode and the adapter resolved together). It subclasses Error so a blanket rescue Moderate::Error still catches it.