package verification import "fmt" // InvalidPhoneNumberError indicates phone number format is invalid type InvalidPhoneNumberError struct { Phone string } func (e *InvalidPhoneNumberError) Error() string { return fmt.Sprintf("invalid phone number format: %s", e.Phone) } // PhoneAlreadyVerifiedError indicates phone is already verified by another account type PhoneAlreadyVerifiedError struct { PhoneHash string } func (e *PhoneAlreadyVerifiedError) Error() string { return "this phone number is already verified by another account" } // RateLimitExceededError indicates too many verification requests type RateLimitExceededError struct { Identifier string RetryAfter int // seconds } func (e *RateLimitExceededError) Error() string { return fmt.Sprintf("rate limit exceeded, retry after %d seconds", e.RetryAfter) } // SMSDeliveryFailedError indicates SMS failed to send type SMSDeliveryFailedError struct { Reason string } func (e *SMSDeliveryFailedError) Error() string { return fmt.Sprintf("failed to send SMS: %s", e.Reason) } // InvalidCodeError indicates OTP code is incorrect type InvalidCodeError struct{} func (e *InvalidCodeError) Error() string { return "invalid verification code" } // CodeExpiredError indicates OTP code has expired type CodeExpiredError struct{} func (e *CodeExpiredError) Error() string { return "verification code has expired" } // RequestNotFoundError indicates request ID not found type RequestNotFoundError struct { RequestID string } func (e *RequestNotFoundError) Error() string { return fmt.Sprintf("verification request not found: %s", e.RequestID) } // TooManyAttemptsError indicates too many failed verification attempts type TooManyAttemptsError struct{} func (e *TooManyAttemptsError) Error() string { return "too many failed attempts, please request a new code" } // PDSWriteFailedError indicates failure to write to PDS type PDSWriteFailedError struct { DID string Reason string } func (e *PDSWriteFailedError) Error() string { return fmt.Sprintf("failed to write verification to PDS for %s: %s", e.DID, e.Reason) }