Skip to content

Commit

Permalink
HOTFIX: fixed an error when trying to write non-utf file into markdown
Browse files Browse the repository at this point in the history
  • Loading branch information
agoloborodko authored and agoloborodko committed Oct 13, 2024
1 parent 7f100b9 commit f19ff51
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/reposnap/core/markdown_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,11 @@ def _write_file_contents(self, files: List[Path]) -> None:
self.logger.debug(f"File not found: {file_path}. Skipping.")
continue

self._write_file_content(file_path, relative_path.as_posix())
try:
self._write_file_content(file_path, relative_path.as_posix())
except UnicodeDecodeError as e:
self.logger.error(f"UnicodeDecodeError for file {file_path}: {e}")


def _write_file_content(self, file_path: Path, relative_path: str) -> None:
"""
Expand Down

0 comments on commit f19ff51

Please sign in to comment.