Skip to content

Commit f388f92

Browse files
better error handling
1 parent 6bb0816 commit f388f92

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

benchmark/dbally_benchmark/context_benchmark.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
from dbally.audit.event_handlers.cli_event_handler import CLIEventHandler
2020
from dbally.llms.litellm import LiteLLM
2121
from dbally.context import BaseCallerContext
22+
from dbally.iql import IQLError
2223

2324

2425
SQLITE_DB_FILE_REL_PATH = "../../examples/recruiting/data/candidates.db"
@@ -154,6 +155,9 @@ async def generate_iql_from_question(
154155
contexts=contexts,
155156
dry_run=True
156157
)
158+
except IQLError as e:
159+
exc_pretty = traceback.format_exception_only(e.__class__, e)[0]
160+
return question, model_name, f"FAILED: {exc_pretty}({e.source})"
157161
except Exception as e:
158162
exc_pretty = traceback.format_exception_only(e.__class__, e)[0]
159163
return question, model_name, f"FAILED: {exc_pretty}"

0 commit comments

Comments
 (0)