Verify: retry storage exceptions only, let programming errors surface

Catch \Exception (storage adapters throw their own exception types) instead
of \Throwable, so an \Error such as a TypeError is not retried and reported
as an unreadable blob.
This commit is contained in:
2026-10-08 01:21:15 +02:00
parent f415bab519
commit 0b50bb6b81
2 changed files with 12 additions and 2 deletions
+1 -1
View File
@@ -840,7 +840,7 @@ final class Repository {
for ($attempt = 1; $attempt <= self::VERIFY_READ_ATTEMPTS && $encrypted === null; $attempt++) {
try {
$encrypted = $this->backend->getRange('packs/' . substr($pack, 0, 2) . '/' . $pack, $offset, $length);
} catch (\Throwable $e) {
} catch (\Exception $e) { // storage adapters throw their own exceptions; \Error (a bug) is not retried
$stats['readError'] = $e->getMessage();
}
}