Skip to content

Commit

Permalink
feat: print unexpected error traceback in debug logs
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesGuthrie committed Jan 7, 2025
1 parent f283b6c commit 8dde931
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions projects/pgai/pgai/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import signal
import sys
import time
import traceback
from collections.abc import Sequence
from typing import Any

Expand Down Expand Up @@ -319,6 +320,9 @@ def vectorizer_worker(
except Exception as e:
# catch any exceptions, log them, and keep on going
log.error(f"unexpected error: {str(e)}")
for exception_line in traceback.format_exception(e):
for line in exception_line.rstrip().split("\n"):
log.debug(line)
if exit_on_error:
sys.exit(1)

Expand Down

0 comments on commit 8dde931

Please sign in to comment.