From 709157d9edebb1c6d34fe77df893e71cb075a9e4 Mon Sep 17 00:00:00 2001 From: Yuxin Wu Date: Sun, 28 Nov 2021 02:12:39 -0800 Subject: [PATCH] include the file path in error message when opena fails Reviewed By: sujitoc Differential Revision: D32681216 fbshipit-source-id: 646d01d323d60e4fe545275efa49f4a575f6eef7 --- iopath/common/file_io.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iopath/common/file_io.py b/iopath/common/file_io.py index f7d14db..99ef373 100644 --- a/iopath/common/file_io.py +++ b/iopath/common/file_io.py @@ -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