forked from
smokesignal.events/smokesignal
i18n+filtering fork - fluent-templates v2
1use thiserror::Error;
2
3/// Represents errors that can occur during event editing operations.
4///
5/// These errors typically happen when users attempt to modify existing events
6/// and encounter authorization, validation, or type compatibility issues.
7#[derive(Debug, Error)]
8pub enum EditEventError {
9 /// Error when an invalid handle slug is provided.
10 ///
11 /// This error occurs when attempting to edit an event with a handle slug
12 /// that is not properly formatted or does not exist in the system.
13 #[error("error-edit-event-1 Invalid handle slug")]
14 InvalidHandleSlug,
15
16 /// Error when a user is not authorized to edit an event.
17 ///
18 /// This error occurs when a user attempts to edit an event that they
19 /// do not have permission to modify, typically because they are not
20 /// the event creator or an administrator.
21 #[error("error-edit-event-2 Not authorized to edit this event")]
22 NotAuthorized,
23
24 /// Error when attempting to edit an unsupported event type.
25 ///
26 /// This error occurs when a user attempts to edit an event type that
27 /// does not support editing, as only community calendar events can be
28 /// modified after creation.
29 #[error(
30 "error-edit-event-3 Unsupported event type. Only community calendar events can be edited"
31 )]
32 UnsupportedEventType,
33
34 /// Error when attempting to edit location data on an event that has multiple locations.
35 ///
36 /// This error occurs when a user attempts to modify location information for an event
37 /// that has multiple locations defined. Such events can only be edited through the API.
38 #[error("error-edit-event-4 Cannot edit locations: Event has multiple locations")]
39 MultipleLocationsPresent,
40
41 /// Error when attempting to edit location data on an event that has an unsupported location type.
42 ///
43 /// This error occurs when a user attempts to modify location information for an event
44 /// that has a location type that is not supported for editing through the web interface.
45 #[error("error-edit-event-5 Cannot edit locations: Event has unsupported location type")]
46 UnsupportedLocationType,
47
48 /// Error when attempting to edit location data on an event that has no locations.
49 ///
50 /// This error occurs when a user attempts to add location information to an event
51 /// that was not created with location information.
52 #[error("error-edit-event-6 Cannot edit locations: Event has no locations")]
53 NoLocationsPresent,
54}