2 Commits

Author SHA1 Message Date
Fedor Dikarev
d8d0858a3d Merge e7e48d6a8b into 327cd5a69d 2025-01-22 21:20:51 +01:00
Fedor Dikarev
e7e48d6a8b Also retry 408
Co-authored-by: Michael Bowyer <mbowyer@umich.edu>
Signed-off-by: Fedor Dikarev <fedor.dikarev@gmail.com>
2025-01-22 21:20:49 +01:00

View File

@@ -51,7 +51,12 @@ export async function loginStandard(registry: string, username: string, password
}).then(res => { }).then(res => {
if (res.stderr.length > 0 && res.exitCode != 0) { if (res.stderr.length > 0 && res.exitCode != 0) {
let isRetriable: boolean let isRetriable: boolean
isRetriable = res.stderr.trim().endsWith("502 Bad Gateway") function isRetriableError(stderr: string): boolean {
const trimmedError = stderr.trim();
return trimmedError.endsWith("502 Bad Gateway") || trimmedError.includes("408");
}
isRetriable = isRetriableError(res.stderr);
if (!isRetriable || (attempt >= attempts) { if (!isRetriable || (attempt >= attempts) {
throw new Error(res.stderr.trim()); throw new Error(res.stderr.trim());
} }