|  | @@ -1,5 +1,4 @@
 | 
	
		
			
				|  |  |  import logging
 | 
	
		
			
				|  |  | -import os
 | 
	
		
			
				|  |  |  import threading
 | 
	
		
			
				|  |  |  import uuid
 | 
	
		
			
				|  |  |  from collections.abc import Generator
 | 
	
	
		
			
				|  | @@ -8,6 +7,7 @@ from typing import Any, Literal, Union, overload
 | 
	
		
			
				|  |  |  from flask import Flask, current_app
 | 
	
		
			
				|  |  |  from pydantic import ValidationError
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +from configs import dify_config
 | 
	
		
			
				|  |  |  from core.app.app_config.easy_ui_based_app.model_config.converter import ModelConfigConverter
 | 
	
		
			
				|  |  |  from core.app.app_config.features.file_upload.manager import FileUploadConfigManager
 | 
	
		
			
				|  |  |  from core.app.apps.base_app_queue_manager import AppQueueManager, GenerateTaskStoppedError, PublishFrom
 | 
	
	
		
			
				|  | @@ -203,7 +203,7 @@ class CompletionAppGenerator(MessageBasedAppGenerator):
 | 
	
		
			
				|  |  |                  logger.exception("Validation Error when generating")
 | 
	
		
			
				|  |  |                  queue_manager.publish_error(e, PublishFrom.APPLICATION_MANAGER)
 | 
	
		
			
				|  |  |              except (ValueError, InvokeError) as e:
 | 
	
		
			
				|  |  | -                if os.environ.get("DEBUG") and os.environ.get("DEBUG").lower() == "true":
 | 
	
		
			
				|  |  | +                if dify_config.DEBUG:
 | 
	
		
			
				|  |  |                      logger.exception("Error when generating")
 | 
	
		
			
				|  |  |                  queue_manager.publish_error(e, PublishFrom.APPLICATION_MANAGER)
 | 
	
		
			
				|  |  |              except Exception as e:
 |