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

Commit

Permalink
Printing out error's underlying reason (#1227)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
snisarg authored and facebook-github-bot committed Jan 11, 2020
1 parent fe3dc65 commit cca848c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pytext/config/serialize.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,11 @@ def _union_from_json(subclasses, json_obj):
return _value_from_json(subclasses_dict[type_name], json_obj)
except Exception as e:
raise UnionTypeError(
f"failed to parse union {subclasses} from json payload {json_obj}"
(
f"failed to parse union {subclasses} from"
f"json payload {json_obj} \n"
f"Reason: {e}"
)
) from e


Expand Down

0 comments on commit cca848c

Please sign in to comment.