Commit a78bd0f
Ziang Zhang
fix: wrap all type-hint resolution errors in CodecError
Codec.decode documented that it raises CodecError on any structural
mismatch or conversion failure, but get_type_hints can also raise
AttributeError (stale qualified references), TypeError (malformed
expressions), and SyntaxError (invalid annotations). These escaped
the CodecError contract.
Fix: broaden the except clause to catch all four exception types.
Closes #381 parent d3ff3f4 commit a78bd0f
2 files changed
Lines changed: 28 additions & 2 deletions
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
908 | 908 | | |
909 | 909 | | |
910 | 910 | | |
911 | | - | |
| 911 | + | |
912 | 912 | | |
913 | 913 | | |
914 | | - | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
915 | 917 | | |
916 | 918 | | |
917 | 919 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
786 | 786 | | |
787 | 787 | | |
788 | 788 | | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
789 | 813 | | |
790 | 814 | | |
791 | 815 | | |
| |||
0 commit comments