from typing import Any from fansifter_common.exceptions import FansifterError, ObjectNotFoundError class UnsupportedProfileIdentifierError(Exception): """Raised when a profile identifier is not supported.""" class ProfileNotFoundError(ObjectNotFoundError): code = "profile_not_found" message = "Profile not found" def __init__( self, message: str | None = None, *, code: str | None = None, context: dict[str, Any] | None = None, ) -> None: super().__init__(message, code=code) self.context = context or {} class ProfileDateOfBirthUpdateNotAllowedError(FansifterError): code = "profile_date_of_birth_update_not_allowed" message = "Profile date of birth update not allowed for your country" status_code = 400 class ProfileBirthdayUpdateNotAllowedError(FansifterError): code = "profile_birthday_update_not_allowed" message = ( "Profile birthday update not allowed for your country, " "please use date of birth instead" ) status_code = 400 class ProfileEmailAlreadyInUseError(FansifterError): code = "profile_email_already_in_use" message = "The email address is already in use" status_code = 400