Skip to content

Commit

Permalink
strip extra char from error msg
Browse files Browse the repository at this point in the history
  • Loading branch information
dillonalaird committed Jul 2, 2024
1 parent d58fd53 commit d69d542
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions vision_agent/utils/execute.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,8 +353,10 @@ def from_exception(exec: Exception, traceback_raw: List[str]) -> "Execution":
return Execution(
error=Error(
name=exec.__class__.__name__,
value=str(exec),
traceback_raw=traceback_raw,
value=_remove_escape_and_color_codes(str(exec)),
traceback_raw=[
_remove_escape_and_color_codes(e) for e in traceback_raw
],
)
)

Expand All @@ -369,8 +371,11 @@ def from_e2b_execution(exec: E2BExecution) -> "Execution": # type: ignore
error=(
Error(
name=exec.error.name,
value=exec.error.value,
traceback_raw=exec.error.traceback_raw,
value=_remove_escape_and_color_codes(exec.error.value),
traceback_raw=[
_remove_escape_and_color_codes(e)
for e in exec.error.traceback_raw
],
)
if exec.error
else None
Expand Down

0 comments on commit d69d542

Please sign in to comment.