Skip to content

Commit

Permalink
include the file path in error message when opena fails
Browse files Browse the repository at this point in the history
Reviewed By: sujitoc

Differential Revision: D32681216

fbshipit-source-id: 646d01d323d60e4fe545275efa49f4a575f6eef7
  • Loading branch information
ppwwyyxx authored and facebook-github-bot committed Nov 28, 2021
1 parent 68d2b5e commit 709157d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion iopath/common/file_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ async def my_function():
# Restrict mode until `NonBlockingIO` has async read feature.
valid_modes = {"w", "a", "b"}
if not all(m in valid_modes for m in mode):
raise ValueError("`opena` mode must be write or append")
raise ValueError(f"`opena` mode must be write or append for path {path}")

# TODO: Each `PathHandler` should set its own `self._buffered`
# parameter and pass that in here. Until then, we assume no
Expand Down

0 comments on commit 709157d

Please sign in to comment.