Skip to content

Commit

Permalink
feat: add debug log in error
Browse files Browse the repository at this point in the history
  • Loading branch information
01Joseph-Hwang10 committed May 15, 2024
1 parent 8c81441 commit 9e43fa5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ldm/cli/_error.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
from typing import Callable
from traceback import format_exc
from ..logger import Logger


def error_boundary(func: Callable, logger: Logger):
try:
func()
except Exception as e:
for line in format_exc().split("\n"):
logger.debug(line)
for line in str(e).split("\n"):
logger.error(line)
exit(1)

0 comments on commit 9e43fa5

Please sign in to comment.