Skip to content
This repository was archived by the owner on Nov 22, 2022. It is now read-only.

Commit cca848c

Browse files
snisargfacebook-github-bot
authored andcommitted
Printing out error's underlying reason (#1227)
Summary: Pull Request resolved: #1227 Even though the root exception is added in the "raise from" clause, the logs don't show the underlying root cause. It's faster to find problems if we print it out this way Reviewed By: hikushalhere Differential Revision: D19171878 fbshipit-source-id: 8cdb6337d7abedb5904b03e5841070828ae2a4fd
1 parent fe3dc65 commit cca848c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pytext/config/serialize.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,11 @@ def _union_from_json(subclasses, json_obj):
8686
return _value_from_json(subclasses_dict[type_name], json_obj)
8787
except Exception as e:
8888
raise UnionTypeError(
89-
f"failed to parse union {subclasses} from json payload {json_obj}"
89+
(
90+
f"failed to parse union {subclasses} from"
91+
f"json payload {json_obj} \n"
92+
f"Reason: {e}"
93+
)
9094
) from e
9195

9296

0 commit comments

Comments
 (0)