autumn_plugin_meta_pixel/error.rs
1//! Errors.
2
3/// A plugin error.
4#[derive(Debug, Clone, PartialEq, Eq, thiserror::Error)]
5#[non_exhaustive]
6pub enum MetaPixelError {
7 /// Bad `[meta_pixel]` config, or a config file that cannot be read.
8 #[error("meta_pixel config: {0}")]
9 Config(String),
10 /// The Content-Security-Policy blocks the pixel.
11 #[error("meta_pixel CSP: {0}")]
12 Csp(String),
13 /// A custom event name breaks the rules of
14 /// [`is_valid_event_name`](crate::policy::is_valid_event_name).
15 #[error(
16 "meta_pixel: custom event name {0:?} is not valid; use 1 to 50 characters from A-Z a-z 0-9 _"
17 )]
18 EventName(String),
19}