Skip to content

Commit 12c30d3

Browse files
committed
Log the full traceback on error
Signed-off-by: Keshav Priyadarshi <git@keshav.space>
1 parent 2908673 commit 12c30d3

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

fedcode/management/commands/tasks.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
# See https://github.com/nexB/federatedcode for support or download.
77
# See https://aboutcode.org for more information about AboutCode.org OSS projects.
88
#
9+
from traceback import format_exc as traceback_format_exc
10+
911
from django.core.management.base import BaseCommand
1012
from django.core.management.base import CommandError
1113

@@ -29,7 +31,9 @@ def sync_task():
2931
importer.run()
3032
sync_r.done = True
3133
except Exception as e:
32-
sync_r.error_message = e
34+
sync_r.error_message = (
35+
f"Failed to sync {sync_r.repo!r} {e!r} \n {traceback_format_exc()}"
36+
)
3337
finally:
3438
sync_r.save()
3539

0 commit comments

Comments
 (0)