trim stderr for checking

Signed-off-by: Fedor Dikarev <fedor.dikarev@gmail.com>
This commit is contained in:
Fedor Dikarev 2024-10-29 22:06:33 +01:00
parent 8479e9040e
commit 162c32cf05

View file

@ -51,7 +51,7 @@ 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.endsWith("502 Bad Gateway") isRetriable = res.stderr.trim().endsWith("502 Bad Gateway")
if (!isRetriable || (attempt >= attempts) { if (!isRetriable || (attempt >= attempts) {
throw new Error(res.stderr.trim()); throw new Error(res.stderr.trim());
} }