| 
									
										
										
										
											2024-06-15 02:46:02 +08:00
										 |  |  | from libs.exception import BaseHTTPException | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class ApiKeyAuthFailedError(BaseHTTPException): | 
					
						
							| 
									
										
										
										
											2024-08-26 15:29:10 +08:00
										 |  |  |     error_code = "auth_failed" | 
					
						
							| 
									
										
										
										
											2024-06-15 02:46:02 +08:00
										 |  |  |     description = "{message}" | 
					
						
							|  |  |  |     code = 500 | 
					
						
							| 
									
										
										
										
											2024-07-05 13:38:51 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class InvalidEmailError(BaseHTTPException): | 
					
						
							| 
									
										
										
										
											2024-08-26 15:29:10 +08:00
										 |  |  |     error_code = "invalid_email" | 
					
						
							| 
									
										
										
										
											2024-07-05 13:38:51 +08:00
										 |  |  |     description = "The email address is not valid." | 
					
						
							|  |  |  |     code = 400 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class PasswordMismatchError(BaseHTTPException): | 
					
						
							| 
									
										
										
										
											2024-08-26 15:29:10 +08:00
										 |  |  |     error_code = "password_mismatch" | 
					
						
							| 
									
										
										
										
											2024-07-05 13:38:51 +08:00
										 |  |  |     description = "The passwords do not match." | 
					
						
							|  |  |  |     code = 400 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class InvalidTokenError(BaseHTTPException): | 
					
						
							| 
									
										
										
										
											2024-08-26 15:29:10 +08:00
										 |  |  |     error_code = "invalid_or_expired_token" | 
					
						
							| 
									
										
										
										
											2024-07-05 13:38:51 +08:00
										 |  |  |     description = "The token is invalid or has expired." | 
					
						
							|  |  |  |     code = 400 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class PasswordResetRateLimitExceededError(BaseHTTPException): | 
					
						
							| 
									
										
										
										
											2024-08-26 15:29:10 +08:00
										 |  |  |     error_code = "password_reset_rate_limit_exceeded" | 
					
						
							| 
									
										
										
										
											2024-10-21 10:03:40 +08:00
										 |  |  |     description = "Too many password reset emails have been sent. Please try again in 1 minutes." | 
					
						
							|  |  |  |     code = 429 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class EmailCodeError(BaseHTTPException): | 
					
						
							|  |  |  |     error_code = "email_code_error" | 
					
						
							|  |  |  |     description = "Email code is invalid or expired." | 
					
						
							|  |  |  |     code = 400 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class EmailOrPasswordMismatchError(BaseHTTPException): | 
					
						
							|  |  |  |     error_code = "email_or_password_mismatch" | 
					
						
							|  |  |  |     description = "The email or password is mismatched." | 
					
						
							|  |  |  |     code = 400 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class EmailPasswordLoginLimitError(BaseHTTPException): | 
					
						
							|  |  |  |     error_code = "email_code_login_limit" | 
					
						
							|  |  |  |     description = "Too many incorrect password attempts. Please try again later." | 
					
						
							|  |  |  |     code = 429 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class EmailCodeLoginRateLimitExceededError(BaseHTTPException): | 
					
						
							|  |  |  |     error_code = "email_code_login_rate_limit_exceeded" | 
					
						
							|  |  |  |     description = "Too many login emails have been sent. Please try again in 5 minutes." | 
					
						
							| 
									
										
										
										
											2024-07-05 13:38:51 +08:00
										 |  |  |     code = 429 | 
					
						
							| 
									
										
										
										
											2024-12-29 22:33:42 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class EmailCodeAccountDeletionRateLimitExceededError(BaseHTTPException): | 
					
						
							|  |  |  |     error_code = "email_code_account_deletion_rate_limit_exceeded" | 
					
						
							|  |  |  |     description = "Too many account deletion emails have been sent. Please try again in 5 minutes." | 
					
						
							|  |  |  |     code = 429 |