1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

#13334: Capture exception class when recording job error

This commit is contained in:
Jeremy Stretch
2023-12-01 10:54:46 -05:00
parent 0340a5e8d6
commit 0c9919a5e8
4 changed files with 5 additions and 5 deletions

View File

@@ -25,7 +25,7 @@ def sync_datasource(job, *args, **kwargs):
job.terminate()
except Exception as e:
job.terminate(status=JobStatusChoices.STATUS_ERRORED, error=str(e))
job.terminate(status=JobStatusChoices.STATUS_ERRORED, error=repr(e))
DataSource.objects.filter(pk=datasource.pk).update(status=DataSourceStatusChoices.FAILED)
if type(e) in (SyncError, JobTimeoutException):
logging.error(e)