Skip to content

Commit

Permalink
fix: when patch failed due to bad path, include pwd in message for fa…
Browse files Browse the repository at this point in the history
…st recovery
  • Loading branch information
ErikBjare committed Dec 11, 2024
1 parent c86b47c commit 202869e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion gptme/tools/patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,11 @@ def execute_patch_impl(
warnings_str = ("\n".join(warnings) + "\n") if warnings else ""
yield Message("system", f"{warnings_str}Patch successfully applied to {path}")

except (ValueError, FileNotFoundError) as e:
except FileNotFoundError:
raise ValueError(
f"Patch failed: No such file or directory '{path}' (pwd: {Path.cwd()})"
) from None
except ValueError as e:
raise ValueError(f"Patch failed: {e.args[0]}") from None


Expand Down

0 comments on commit 202869e

Please sign in to comment.