| 
									
										
										
										
											2023-05-15 08:51:32 +08:00
										 |  |  | from libs.exception import BaseHTTPException | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class AlreadySetupError(BaseHTTPException): | 
					
						
							|  |  |  |     error_code = 'already_setup' | 
					
						
							| 
									
										
										
										
											2023-05-22 17:39:28 +08:00
										 |  |  |     description = "Dify has been successfully installed. Please refresh the page or return to the dashboard homepage." | 
					
						
							| 
									
										
										
										
											2023-05-15 08:51:32 +08:00
										 |  |  |     code = 403 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class NotSetupError(BaseHTTPException): | 
					
						
							|  |  |  |     error_code = 'not_setup' | 
					
						
							| 
									
										
										
										
											2023-05-22 17:39:28 +08:00
										 |  |  |     description = "Dify has not been initialized and installed yet. " \ | 
					
						
							|  |  |  |                   "Please proceed with the initialization and installation process first." | 
					
						
							| 
									
										
										
										
											2023-05-15 08:51:32 +08:00
										 |  |  |     code = 401 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-02-01 15:03:56 +08:00
										 |  |  | class NotInitValidateError(BaseHTTPException): | 
					
						
							|  |  |  |     error_code = 'not_init_validated' | 
					
						
							|  |  |  |     description = "Init validation has not been completed yet. " \ | 
					
						
							|  |  |  |                   "Please proceed with the init validation process first." | 
					
						
							|  |  |  |     code = 401 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class InitValidateFailedError(BaseHTTPException): | 
					
						
							|  |  |  |     error_code = 'init_validate_failed' | 
					
						
							|  |  |  |     description = "Init validation failed. Please check the password and try again." | 
					
						
							|  |  |  |     code = 401 | 
					
						
							| 
									
										
										
										
											2023-05-15 08:51:32 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | class AccountNotLinkTenantError(BaseHTTPException): | 
					
						
							|  |  |  |     error_code = 'account_not_link_tenant' | 
					
						
							|  |  |  |     description = "Account not link tenant." | 
					
						
							|  |  |  |     code = 403 | 
					
						
							| 
									
										
										
										
											2023-07-14 11:19:26 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class AlreadyActivateError(BaseHTTPException): | 
					
						
							|  |  |  |     error_code = 'already_activate' | 
					
						
							|  |  |  |     description = "Auth Token is invalid or account already activated, please check again." | 
					
						
							|  |  |  |     code = 403 |