Commit 077f92b
Classify wrapped DqliteConnectionError via __cause__ in is_disconnect
The dbapi's _call_client wraps a client-level DqliteConnectionError
into a bare OperationalError, so the direct isinstance check in
is_disconnect against DqliteConnectionError only fires for connect-
path errors, not cursor-path ones. Walk the standard __cause__ chain
— set automatically by `raise ... from e` — so the chained form is
classified identically without inventing a new attribute on the
dbapi exception. The existing substring fallback still catches any
wrapper without a __cause__.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 770b778 commit 077f92b
2 files changed
Lines changed: 27 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
350 | 350 | | |
351 | 351 | | |
352 | 352 | | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
353 | 362 | | |
354 | 363 | | |
355 | 364 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
381 | 381 | | |
382 | 382 | | |
383 | 383 | | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
384 | 402 | | |
385 | 403 | | |
386 | 404 | | |
| |||
0 commit comments