[BE]: Improve exception typing. Remove NOQAs (#125535)

Improve some exception typing

Pull Request resolved: https://github.com/pytorch/pytorch/pull/125535
Approved by: https://github.com/albanD
This commit is contained in:
Aaron Gokaslan
2024-05-08 14:07:13 +00:00
committed by PyTorch MergeBot
parent 82b7b59d2a
commit 8cad88e1f3
9 changed files with 16 additions and 16 deletions

View File

@ -986,7 +986,7 @@ class SummaryWriter:
"warning: Embedding dir exists, did you set global_step for add_embedding()?"
)
else:
raise Exception( # noqa: TRY002
raise FileExistsError(
f"Path: `{save_path}` exists, but is a file. Cannot proceed."
)
else: