From 01154d0ae6658d31d3bac801c843a34fa4b3ed30 Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Tue, 3 Oct 2017 14:46:59 -0700 Subject: [PATCH] s3: better error messages --- src/storage/s3.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/storage/s3.js b/src/storage/s3.js index 3b637486f..c4c6d39ec 100644 --- a/src/storage/s3.js +++ b/src/storage/s3.js @@ -110,7 +110,7 @@ function upload(apiConfig, backupFilePath, sourceStream, callback) { s3.upload(params, { partSize: 10 * 1024 * 1024, queueSize: 1 }, function (error) { if (error) { debug('[%s] upload: s3 upload error.', backupFilePath, error); - return callback(new BackupsError(BackupsError.EXTERNAL_ERROR, error.message)); + return callback(new BackupsError(BackupsError.EXTERNAL_ERROR, `Error uploading ${backupFilePath}: ${error.message}`)); } callback(null); @@ -245,10 +245,10 @@ function copy(apiConfig, oldFilePath, newFilePath, callback) { progress.setDetail(progress.BACKUP, 'Copying ' + content.Key.slice(oldFilePath.length+1)); s3.copyObject(copyParams, function (error) { - if (error && error.code === 'NoSuchKey') return iteratorCallback(new BackupsError(BackupsError.NOT_FOUND, 'Old backup not found')); + if (error && error.code === 'NoSuchKey') return iteratorCallback(new BackupsError(BackupsError.NOT_FOUND, `Old backup ${content.Key} not found`)); if (error) { debug('copy: s3 copy error.', error); - return iteratorCallback(new BackupsError(BackupsError.EXTERNAL_ERROR, error.message)); + return iteratorCallback(new BackupsError(BackupsError.EXTERNAL_ERROR, `Error copying ${content.Key} : ${error.message}`)); } iteratorCallback();