forked from
smokesignal.events/smokesignal
The smokesignal.events web application
1use thiserror::Error;
2
3/// Represents errors that can occur during Bluesky profile import operations.
4///
5/// These errors typically happen when attempting to import a user's Bluesky profile
6/// (`app.bsky.actor.profile`) to create a Smokesignal profile on first login.
7#[derive(Debug, Error)]
8#[allow(clippy::enum_variant_names)]
9pub(crate) enum ProfileImportError {
10 /// Failed to fetch the Bluesky profile from the user's PDS.
11 #[error("error-smokesignal-profile-import-2 Failed to fetch Bluesky profile: {0}")]
12 FetchFailed(String),
13
14 /// Failed to parse the Bluesky profile record.
15 #[error("error-smokesignal-profile-import-3 Failed to parse Bluesky profile: {0}")]
16 ParseFailed(String),
17
18 /// Failed to download the avatar blob from PDS.
19 #[error("error-smokesignal-profile-import-4 Failed to download avatar: {0}")]
20 AvatarDownloadFailed(String),
21
22 /// Failed to process the avatar image through the image pipeline.
23 #[error("error-smokesignal-profile-import-5 Failed to process avatar: {0}")]
24 AvatarProcessFailed(String),
25
26 /// Failed to upload the processed avatar to the user's PDS.
27 #[error("error-smokesignal-profile-import-6 Failed to upload avatar: {0}")]
28 AvatarUploadFailed(String),
29
30 /// Failed to write the new Smokesignal profile to the user's PDS.
31 #[error("error-smokesignal-profile-import-7 Failed to write profile to PDS: {0}")]
32 PdsWriteFailed(String),
33
34 /// Failed to store the profile locally in the database.
35 #[error("error-smokesignal-profile-import-8 Failed to store profile locally: {0}")]
36 StorageFailed(String),
37}