Skip to content

Commit

Permalink
slob writer: change "already exists" exception to WriteError to avoid…
Browse files Browse the repository at this point in the history
… showing stacktrace
  • Loading branch information
ilius committed Jan 24, 2025
1 parent 97fae33 commit eae7a44
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pyglossary/plugins/aard2_slob/writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
from os.path import isfile, splitext
from typing import TYPE_CHECKING

from pyglossary.glossary_utils import WriteError

if TYPE_CHECKING:
from collections.abc import Generator

Expand Down Expand Up @@ -121,7 +123,7 @@ def open(self, filename: str) -> None:
exc_note(e, f"Run `{pip} install PyICU` to install")
raise
if isfile(filename):
raise OSError(f"File '{filename}' already exists")
raise WriteError(f"File '{filename}' already exists")
namePostfix = ""
if self._file_size_approx > 0:
namePostfix = " (part 1)"
Expand Down

0 comments on commit eae7a44

Please sign in to comment.