From 0e5d926e7abcaa1474b3cbadcb252273f0a32d58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Thu, 14 Jul 2022 10:06:20 +0200 Subject: [PATCH] Better error message for an assertion In some unexpected situations BAT would just show that the `bfile_pp is not None` assertion failed. Now it also shows which file is the one causing this issue, aiding in debugging the situation. --- blender_asset_tracer/pack/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/blender_asset_tracer/pack/__init__.py b/blender_asset_tracer/pack/__init__.py index 72980b6..3a60bc4 100644 --- a/blender_asset_tracer/pack/__init__.py +++ b/blender_asset_tracer/pack/__init__.py @@ -475,7 +475,8 @@ class Packer: # It is *not* used for any disk I/O, since the file may not even # exist on the local filesystem. bfile_pp = action.new_path - assert bfile_pp is not None + assert bfile_pp is not None, \ + f"Action {action.path_action.name} on {bfile_path} has no final path set, unable to process" # Use tempfile to create a unique name in our temporary directoy. # The file should be deleted when self.close() is called, and not