package users import "fmt" // Domain errors for user service operations // These map to lexicon error types defined in social.coves.actor.signup type InvalidHandleError struct { Handle string Reason string } func (e *InvalidHandleError) Error() string { return fmt.Sprintf("invalid handle %q: %s", e.Handle, e.Reason) } type HandleNotAvailableError struct { Handle string } func (e *HandleNotAvailableError) Error() string { return fmt.Sprintf("handle %q is not available", e.Handle) } type InvalidInviteCodeError struct { Code string } func (e *InvalidInviteCodeError) Error() string { return "invalid or expired invite code" } type InvalidEmailError struct { Email string } func (e *InvalidEmailError) Error() string { return fmt.Sprintf("invalid email address: %q", e.Email) } type WeakPasswordError struct { Reason string } func (e *WeakPasswordError) Error() string { return fmt.Sprintf("password does not meet strength requirements: %s", e.Reason) } // PDSError wraps errors from the PDS that we couldn't map to domain errors type PDSError struct { Message string StatusCode int } func (e *PDSError) Error() string { return fmt.Sprintf("PDS error (%d): %s", e.StatusCode, e.Message) }