diff --git a/src/storage/s3.js b/src/storage/s3.js index fcd6ce046..d22ea89f0 100644 --- a/src/storage/s3.js +++ b/src/storage/s3.js @@ -220,7 +220,7 @@ function copy(apiConfig, oldFilePath, newFilePath) { if (error) debug(`copy: s3 copy error when copying ${entry.fullPath}: ${error}`); if (error && S3_NOT_FOUND(error)) return iteratorCallback(new BoxError(BoxError.NOT_FOUND, `Old backup not found: ${entry.fullPath}`)); - if (error) return iteratorCallback(new BoxError(BoxError.EXTERNAL_ERROR, `Error copying ${entry.fullPath} : ${error.code} ${error}`)); + if (error) return iteratorCallback(new BoxError(BoxError.EXTERNAL_ERROR, `Error copying ${entry.fullPath} (${entry.size} bytes): ${error.code || ''} ${error}`)); iteratorCallback(null); } @@ -282,6 +282,8 @@ function copy(apiConfig, oldFilePath, newFilePath) { events.emit('progress', `Uploaded part ${partCopyParams.PartNumber} - Etag: ${result.CopyPartResult.ETag}`); + if (!result.CopyPartResult.ETag) return done(new Error('Multi-part copy is broken or not implemented by the S3 storage provider')); + uploadedParts.push({ ETag: result.CopyPartResult.ETag, PartNumber: partNumber }); if (endBytes < size) {