forked from
smokesignal.events/smokesignal
i18n+filtering fork - fluent-templates v2
1use thiserror::Error;
2
3/// Represents errors that can occur during event migration operations.
4///
5/// These errors typically happen when attempting to migrate events between
6/// different formats or systems, such as from smokesignal to community events.
7#[derive(Debug, Error)]
8pub enum MigrateEventError {
9 /// Error when an invalid handle slug is provided.
10 ///
11 /// This error occurs when attempting to migrate an event with a handle slug
12 /// that is not properly formatted or does not exist in the system.
13 #[error("error-migrate-event-1 Invalid handle slug")]
14 InvalidHandleSlug,
15
16 /// Error when a user is not authorized to migrate an event.
17 ///
18 /// This error occurs when a user attempts to migrate 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-migrate-event-2 Not authorized to migrate this event")]
22 NotAuthorized,
23
24 /// Error when attempting to migrate an unsupported event type.
25 ///
26 /// This error occurs when a user attempts to migrate an event type that
27 /// cannot be migrated, as only smokesignal events can be converted to
28 /// the community event format.
29 #[error(
30 "error-migrate-event-3 Unsupported event type. Only smokesignal events can be migrated"
31 )]
32 UnsupportedEventType,
33
34 /// Error when an event has already been migrated.
35 ///
36 /// This error occurs when attempting to migrate an event that is already
37 /// in the community event format, which would be redundant.
38 #[error("error-migrate-event-4 Event is already a community event")]
39 AlreadyMigrated,
40
41 /// Error when a destination URI conflict exists.
42 ///
43 /// This error occurs when attempting to migrate an event to a URI that
44 /// already has an event associated with it, which would cause a conflict.
45 #[error("error-migrate-event-5 An event already exists at the destination URI")]
46 DestinationExists,
47}