Commit bedcc27
fix: survive a 403 whose body is not a JSON object
GithubException.data is whatever the response decoded to: None for an
empty body, a str for a non-JSON one. Calling .get on it raises inside
the 403 handler, and an exception raised there is not caught by the
sibling except clauses — it escapes add_pr_comments and fails the step.
That is the opposite of what this handler exists to do.
Verified both shapes raise before the guard and warn after it. The test
stub now stores data exactly as PyGithub does; coercing a falsy payload
to {} was hiding the shapes the handler has to survive.
The 403 test also asserts the API's own message reaches the warning, so
dropping the detail cannot pass unnoticed.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01U9zFxq8V4qxG4aMzJhGBFn1 parent 2123307 commit bedcc27
2 files changed
Lines changed: 24 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
882 | 882 | | |
883 | 883 | | |
884 | 884 | | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
885 | 890 | | |
886 | 891 | | |
887 | 892 | | |
888 | | - | |
| 893 | + | |
889 | 894 | | |
890 | 895 | | |
891 | 896 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1095 | 1095 | | |
1096 | 1096 | | |
1097 | 1097 | | |
1098 | | - | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
1099 | 1101 | | |
1100 | 1102 | | |
1101 | 1103 | | |
| |||
1149 | 1151 | | |
1150 | 1152 | | |
1151 | 1153 | | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + | |
| 1165 | + | |
| 1166 | + | |
| 1167 | + | |
| 1168 | + | |
1152 | 1169 | | |
1153 | 1170 | | |
1154 | 1171 | | |
| |||
0 commit comments