s3: sometimes message is null and only code is valid

This commit is contained in:
Girish Ramakrishnan
2024-08-13 07:08:21 +02:00
parent 1e5e4e3189
commit 4a29371907

View File

@@ -133,7 +133,7 @@ async function upload(apiConfig, backupFilePath) {
stream: passThrough,
async finish() {
const [error, data] = await safe(uploadPromise);
if (error) throw new BoxError(BoxError.EXTERNAL_ERROR, `Upload error: ${error.message}`);
if (error) throw new BoxError(BoxError.EXTERNAL_ERROR, `Upload error: code: ${error.code} message: ${error.message}`); // sometimes message is null
debug(`Upload finished. ${JSON.stringify(data)}`);
}
};