diff --git a/invokeai/app/services/model_install/model_install_default.py b/invokeai/app/services/model_install/model_install_default.py index dd1b44d899..9ad6424053 100644 --- a/invokeai/app/services/model_install/model_install_default.py +++ b/invokeai/app/services/model_install/model_install_default.py @@ -848,7 +848,7 @@ class ModelInstallService(ModelInstallServiceBase): with self._lock: if install_job := self._download_cache.pop(download_job.id, None): assert excp is not None - install_job.set_error(excp) + self._set_error(install_job, excp) self._download_queue.cancel_job(download_job) # Let other threads know that the number of downloads has changed diff --git a/tests/app/services/model_install/test_model_install.py b/tests/app/services/model_install/test_model_install.py index 0c212cca76..5e4f2a389f 100644 --- a/tests/app/services/model_install/test_model_install.py +++ b/tests/app/services/model_install/test_model_install.py @@ -18,6 +18,7 @@ from invokeai.app.services.events.events_common import ( ModelInstallDownloadProgressEvent, ModelInstallDownloadsCompleteEvent, ModelInstallDownloadStartedEvent, + ModelInstallErrorEvent, ModelInstallStartedEvent, ) from invokeai.app.services.model_install import ( @@ -339,7 +340,13 @@ def test_404_download(mm2_installer: ModelInstallServiceBase, mm2_app_config: In assert job.error_type == "HTTPError" assert job.error assert "NOT FOUND" in job.error + assert job.error_traceback is not None assert job.error_traceback.startswith("Traceback") + bus = mm2_installer.event_bus + assert bus is not None + assert hasattr(bus, "events") # the dummyeventservice has this + event_types = [type(x) for x in bus.events] + assert ModelInstallErrorEvent in event_types def test_other_error_during_install(