Something went wrong. Try again.
The smokesignal.events web application forked from smokesignal.events/smokesignal
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107use thiserror::Error;
/// Represents errors that can occur during blob and profile handling operations.////// These errors typically occur during avatar, banner, and header image uploads,/// as well as AT Protocol profile record management.#[derive(Debug, Error)]pub(crate) enum BlobError { /// Error when uploading a blob to the PDS fails. /// /// This error occurs when the blob upload operation to the Personal Data /// Server fails, typically due to network issues or server errors. #[error("error-smokesignal-blob-1 Failed to upload blob: {0}")] BlobUploadFailed(String),
/// Error when parsing the blob upload response fails. /// /// This error occurs when the PDS returns a response that cannot be /// parsed as a valid upload response structure. #[error("error-smokesignal-blob-2 Failed to parse upload response: {0}")] UploadResponseParseFailed(String),
/// Error when processing multipart form data fails. /// /// This error occurs when extracting multipart form data from the /// request fails, typically due to malformed data. #[error("error-smokesignal-blob-3 Multipart error: {0}")] MultipartError(String),
/// Error when reading file data from multipart fails. /// /// This error occurs when reading the file content from a multipart /// field fails, typically due to I/O errors. #[error("error-smokesignal-blob-4 Failed to read file: {0}")] FileReadFailed(String),
/// Error when no avatar file is provided in the upload. /// /// This error occurs when the expected avatar file field is missing /// from the multipart form data. #[error("error-smokesignal-blob-5 No avatar file provided")] NoAvatarFile,
/// Error when authentication backend doesn't match configuration. /// /// This error occurs when the user's authentication method (PDS/AIP) /// doesn't match the configured OAuth backend. #[error("error-smokesignal-blob-7 Mismatched auth and backend config")] MismatchedAuthBackend,
/// Error when parsing an existing profile record fails. /// /// This error occurs when deserializing a profile record from the PDS /// fails, typically due to malformed JSON data. #[error("error-smokesignal-blob-8 Failed to parse existing profile: {0}")] ExistingProfileParseFailed(String),
/// Error when profile validation fails. /// /// This error occurs when a profile record fails validation checks /// before being written to the PDS. #[error("error-smokesignal-blob-9 Profile validation failed: {0}")] ProfileValidationFailed(String),
/// Error when serializing a profile record fails. /// /// This error occurs when converting a profile struct to JSON format /// fails during the putRecord operation. #[error("error-smokesignal-blob-10 Failed to serialize profile: {0}")] ProfileSerializeFailed(String),
/// Error when serializing a putRecord request fails. /// /// This error occurs when serializing the putRecord request body /// to JSON format fails. #[error("error-smokesignal-blob-11 Failed to serialize putRecord request: {0}")] PutRecordSerializeFailed(String),
/// Error when the putRecord operation fails. /// /// This error occurs when the AT Protocol putRecord operation returns /// an error, preventing the profile update. #[error("error-smokesignal-blob-12 putRecord failed: {0}")] PutRecordFailed(String),
/// Error when no banner file is provided in the upload. /// /// This error occurs when the expected banner file field is missing /// from the multipart form data. #[error("error-smokesignal-blob-15 No banner file provided")] NoBannerFile,
/// Error when no header file is provided in the upload. /// /// This error occurs when the expected header file field is missing /// from the multipart form data. #[error("error-smokesignal-blob-37 No header file provided")] NoHeaderFile,
/// Error from image processing operations. /// /// This error wraps `ImageError` and is automatically converted from /// image processing functions using the `?` operator. #[error(transparent)] ImageError(#[from] crate::image_errors::ImageError),}