Commit dc2e654
fix: record last_err on get_resource_policy / get_user_by_email failures
Address Copilot review: both methods returned None on an HTTP error without
retaining the failing Response, so a caller could not tell a real HTTP error
from a genuine "no policy" / "no such user" (both None). Record self._last_err
on the non-200 path in each, matching the last_err bookkeeping the rest of this
PR relies on. Also stop logging a plain 404 miss at error level in
get_user_by_email, and drop the raw email address from the error message.
Tests extended to assert last_err is set (and carries the status code) on both
failure paths.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent 6faffa8 commit dc2e654
2 files changed
Lines changed: 23 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1396 | 1396 | | |
1397 | 1397 | | |
1398 | 1398 | | |
| 1399 | + | |
| 1400 | + | |
| 1401 | + | |
| 1402 | + | |
| 1403 | + | |
| 1404 | + | |
1399 | 1405 | | |
1400 | | - | |
1401 | | - | |
| 1406 | + | |
| 1407 | + | |
1402 | 1408 | | |
1403 | 1409 | | |
1404 | 1410 | | |
| |||
1497 | 1503 | | |
1498 | 1504 | | |
1499 | 1505 | | |
1500 | | - | |
| 1506 | + | |
| 1507 | + | |
| 1508 | + | |
1501 | 1509 | | |
1502 | | - | |
| 1510 | + | |
| 1511 | + | |
| 1512 | + | |
1503 | 1513 | | |
1504 | 1514 | | |
1505 | 1515 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
65 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
66 | 68 | | |
67 | 69 | | |
68 | 70 | | |
69 | 71 | | |
| 72 | + | |
| 73 | + | |
70 | 74 | | |
71 | 75 | | |
72 | 76 | | |
| |||
192 | 196 | | |
193 | 197 | | |
194 | 198 | | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
195 | 202 | | |
196 | 203 | | |
197 | 204 | | |
| |||
0 commit comments