Skip to content

Commit

Permalink
wrap exception printing in repr (#425)
Browse files Browse the repository at this point in the history
  • Loading branch information
leondz authored Jan 23, 2024
1 parent 3870991 commit 1bd7859
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion garak/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def end_run():
try:
write_report_digest(_config.transient.report_filename, digest_filename)
except Exception as e:
print("Didn't successfully build the report - JSON log preserved.", e)
print("Didn't successfully build the report - JSON log preserved.", repr(e))

msg = f"garak run complete in {timetaken:.2f}s"
print(f"✔️ {msg}")
Expand Down
2 changes: 1 addition & 1 deletion garak/generators/langchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def __init__(self, name, generations=10):
try:
llm = getattr(langchain.llms, self.name)()
except Exception as e:
logging.error("Failed to import Langchain module: %s", e)
logging.error("Failed to import Langchain module: %s", repr(e))
raise e

self.generator = llm
Expand Down
2 changes: 1 addition & 1 deletion garak/harnesses/probewise.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def run(self, model, probenames, evaluator, buffs=[]):
probe = _plugins.load_plugin(probename)
except Exception as e:
print(f"failed to load probe {probename}")
logging.warning("failed to load probe %s:", e)
logging.warning("failed to load probe %s:", repr(e))
continue
if not probe:
continue
Expand Down

0 comments on commit 1bd7859

Please sign in to comment.