Commit fe00545
committed
fix(bedrock): only retry transient botocore errors
The previous 'except Exception' caught and retried KeyError from
malformed responses, missing-credential errors, and other programmer or
config mistakes -- wasting up to 6s of backoff per failed call and
hiding the real cause.
Narrow the catch to (ClientError, BotoCoreError) and gate retries with
_is_retryable, which only retries throttling, 5xx, transient model
errors, and transport-level BotoCoreError. Permanent ClientError codes
(ValidationException, AccessDeniedException, ResourceNotFoundException)
and any non-botocore exception surface immediately.
Addresses the Copilot review comment on PR #69.1 parent 956cfa5 commit fe00545
1 file changed
Lines changed: 23 additions & 2 deletions
Lines changed: 23 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
11 | 24 | | |
12 | 25 | | |
13 | 26 | | |
| |||
27 | 40 | | |
28 | 41 | | |
29 | 42 | | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
30 | 51 | | |
31 | 52 | | |
32 | 53 | | |
| |||
51 | 72 | | |
52 | 73 | | |
53 | 74 | | |
54 | | - | |
55 | | - | |
| 75 | + | |
| 76 | + | |
56 | 77 | | |
57 | 78 | | |
58 | 79 | | |
| |||
0 commit comments