From 6af46f9c5f9371ea6cc3cfb1c6d0d2b7121f005f Mon Sep 17 00:00:00 2001 From: maryhipp Date: Fri, 23 Feb 2024 10:40:51 -0500 Subject: [PATCH] add error_reason to ModelInstallJob --- invokeai/app/services/model_install/model_install_base.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/invokeai/app/services/model_install/model_install_base.py b/invokeai/app/services/model_install/model_install_base.py index d1e8e4f8e5..737f62a064 100644 --- a/invokeai/app/services/model_install/model_install_base.py +++ b/invokeai/app/services/model_install/model_install_base.py @@ -156,6 +156,7 @@ class ModelInstallJob(BaseModel): id: int = Field(description="Unique ID for this job") status: InstallStatus = Field(default=InstallStatus.WAITING, description="Current status of install process") + error_reason: Optional[str] = Field(default=None, description="Information about why the job failed") config_in: Dict[str, Any] = Field( default_factory=dict, description="Configuration information (e.g. 'description') to apply to model." ) @@ -193,6 +194,7 @@ class ModelInstallJob(BaseModel): self.error = str(e) self.error_traceback = self._format_error(e) self.status = InstallStatus.ERROR + self.error_reason = self._exception.__class__.__name__ if self._exception else None def cancel(self) -> None: """Call to cancel the job."""