Skip to content

Commit

Permalink
Report import errors when calling delayed gathers.
Browse files Browse the repository at this point in the history
The call delayed gathers function was missing the error handling present for the regular imports.  Add the missing error handling so that errors are properly reported to the user and as many components as possible are imported.
  • Loading branch information
Exairnous committed Jul 24, 2024
1 parent 0ed665d commit 90f08ee
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion addons/io_hubs_addon/io/gltf_importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,18 @@

def call_delayed_gathers():
global delayed_gathers
global import_report
for gather_import in delayed_gathers:
gather_import()
gather_import_args = gather_import.__closure__[0].cell_contents
blender_host = gather_import_args[2]
component_name = gather_import_args[3]
try:
gather_import()
except Exception:
traceback.print_exc()
print(f"Failed to import {component_name} component on {blender_host.name} continuing on...")
import_report.append(
f"Failed to import {component_name} component on {blender_host.name}. See the console for details.")
delayed_gathers.clear()


Expand Down

0 comments on commit 90f08ee

Please sign in to comment.