Skip to main content

configbuilder_pattern_loader/
on_error.rs

1/// Controls what the feature registry does when [`OptionalSection::validate_enabled`]
2/// returns an error for an otherwise-enabled section.
3///
4/// [`OptionalSection::validate_enabled`]: crate::OptionalSection::validate_enabled
5#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
6pub enum OnError {
7    /// Propagate the error -- startup halts immediately. This is the default.
8    #[default]
9    Fail,
10
11    /// Treat the feature as disabled and continue startup.
12    ///
13    /// The validation error reason is recorded in [`crate::FeatureRecord::override_source`]
14    /// as [`crate::OverrideSource::ValidationError`] so operators can inspect it in the
15    /// startup summary without crashing the service.
16    Disable,
17}