i18n+filtering fork - fluent-templates v2
at main 1.7 kB view raw
1use thiserror::Error; 2 3/// Represents errors that can occur during event creation. 4/// 5/// These errors are typically triggered during validation of user-submitted 6/// event creation forms. 7#[derive(Debug, Error)] 8pub enum CreateEventError { 9 /// Error when the event name is not provided. 10 /// 11 /// This error occurs when a user attempts to create an event without 12 /// specifying a name, which is a required field. 13 #[error("error-create-event-1 Name not set")] 14 NameNotSet, 15 16 /// Error when the event description is not provided. 17 /// 18 /// This error occurs when a user attempts to create an event without 19 /// specifying a description, which is a required field. 20 #[error("error-create-event-2 Description not set")] 21 DescriptionNotSet, 22 23 /// Error when the event dates are invalid. 24 /// 25 /// This error occurs when the provided event dates are invalid, such as when 26 /// the end date is before the start date, or dates are outside allowed ranges. 27 #[error("error-create-event-3 Invalid event dates")] 28 InvalidEventDates, 29 30 /// Error when an invalid event mode is specified. 31 /// 32 /// This error occurs when the provided event mode doesn't match one of the 33 /// supported values (e.g., "in-person", "online", "hybrid"). 34 #[error("error-create-event-4 Invalid event mode")] 35 InvalidEventMode, 36 37 /// Error when an invalid event status is specified. 38 /// 39 /// This error occurs when the provided event status doesn't match one of the 40 /// supported values (e.g., "confirmed", "tentative", "cancelled"). 41 #[error("error-create-event-5 Invalid event status")] 42 InvalidEventStatus, 43}