s3: fix malformed endpoint URL from older versions

this is specifically for linode, but may apply for other storages too
This commit is contained in:
Girish Ramakrishnan
2025-07-16 09:12:21 +02:00
parent 32bc082a9f
commit 5548ed1b57
2 changed files with 36 additions and 1 deletions

View File

@@ -46,7 +46,8 @@ function S3_NOT_FOUND(error) {
}
function formatError(error) {
return `code: ${error.Code} message: ${error.message} HTTP: ${error.$metadata.httpStatusCode}`;
// $metadata can be undefined if HTTP request was never sent
return `code: ${error.Code} message: ${error.message} HTTP: ${error.$metadata?.httpStatusCode}`;
}
const RETRY_STRATEGY = new ConfiguredRetryStrategy(10 /* max attempts */, (/* attempt */) => 20000 /* constant backoff */);