mirror of
				https://github.com/nonebot/nonebot2.git
				synced 2025-10-31 15:06:42 +00:00 
			
		
		
		
	♿ raise ImportError when exec_module
This commit is contained in:
		| @@ -221,7 +221,11 @@ class PluginLoader(SourceFileLoader): | ||||
|         if self._export_token: | ||||
|             setattr(module, "__export__", _export.get()) | ||||
|  | ||||
|         super().exec_module(module) | ||||
|         try: | ||||
|             super().exec_module(module) | ||||
|         except Exception as e: | ||||
|             raise ImportError( | ||||
|                 f"Error when executing module {self.name}.") from e | ||||
|  | ||||
|         if self._plugin_token: | ||||
|             _current_plugin.reset(self._plugin_token) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user