Write the content of a file to a given path; raise a ToolError if an error occurs.
(self, path: Path, file: str)
| 260 | raise ToolError(f"Ran into {e} while trying to read {path}") from None |
| 261 | |
| 262 | def write_file(self, path: Path, file: str): |
| 263 | """Write the content of a file to a given path; raise a ToolError if an error occurs.""" |
| 264 | try: |
| 265 | path.write_text(file) |
| 266 | except Exception as e: |
| 267 | raise ToolError(f"Ran into {e} while trying to write to {path}") from None |
| 268 | |
| 269 | def _make_output( |
| 270 | self, |
no test coverage detected