Skip to content

Commit

Permalink
FIX: 例外の情報を追加
Browse files Browse the repository at this point in the history
  • Loading branch information
sabonerune committed Jan 15, 2025
1 parent 1bd3d55 commit 68e3b16
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions voicevox_engine/user_dict/user_dict_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,15 @@ def _delete_file_on_close(file_path: Path) -> None:
None,
)
if h_file == _INVALID_HANDLE_VALUE:
raise RuntimeError(f"Failed to CreateFileW for {file_path}")
raise RuntimeError(
f"Failed to CreateFileW for {file_path}"
) from ctypes.WinError()

result = _CloseHandle(h_file)
if result == 0:
raise RuntimeError(f"Failed to CloseHandle for {file_path}")
raise RuntimeError(
f"Failed to CloseHandle for {file_path}"
) from ctypes.WinError()
else:
file_path.unlink()

Expand Down

0 comments on commit 68e3b16

Please sign in to comment.