".github/git@developer.sourcefind.cn:OpenDAS/mmcv.git" did not exist on "4a044c646663231905c5659d2f83d0abe60e0ed8"
Commit 8339cf26 authored by Jeremy Reizenstein's avatar Jeremy Reizenstein Committed by Facebook GitHub Bot
Browse files

hydra/OC.structured: don't hide error

Summary: Keep the cause of hydra errors visible in some more cases.

Reviewed By: shapovalov

Differential Revision: D40516202

fbshipit-source-id: 8d214be5cc808a37738add77cc305fe099788546
parent 9535c576
......@@ -522,8 +522,12 @@ def get_default_args(C, *, _do_not_process: Tuple[type, ...] = ()) -> DictConfig
try:
out: DictConfig = OmegaConf.structured(C)
except Exception as e:
raise ValueError(f"OmegaConf.structured({C}) failed") from e
except Exception:
print(f"### OmegaConf.structured({C}) failed ###")
# We don't use `raise From` here, because that gets the original
# exception hidden by the OC_CAUSE logic in the case where we are
# called by hydra.
raise
exclude = getattr(C, "_processed_members", ())
with open_dict(out):
for field in exclude:
......@@ -545,8 +549,9 @@ def get_default_args(C, *, _do_not_process: Tuple[type, ...] = ()) -> DictConfig
try:
out: DictConfig = OmegaConf.structured(dataclass)
except Exception as e:
raise ValueError(f"OmegaConf.structured failed for {dataclass_name}") from e
except Exception:
print(f"### OmegaConf.structured failed for {C.__name__} ###")
raise
return out
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment