diff --git a/src/delete.js b/src/delete.js index c74c015..1bb5a4e 100644 --- a/src/delete.js +++ b/src/delete.js @@ -60,7 +60,6 @@ module.exports = async function (uri) { return Promise.resolve(); } } catch (err) { - this.log('error', ['storage.delete', JSON.stringify({ uri, message: err.message, stack: err.stack })]); return Promise.reject(err); } }; diff --git a/src/list.js b/src/list.js index b23f67e..14feaaa 100644 --- a/src/list.js +++ b/src/list.js @@ -24,7 +24,7 @@ const awsListObjects = async (that, bucket, path, next) => { } catch (err) { this.error('error', [ 'storage.list.awsListObjects', - JSON.stringify({ bucket, path, next, message: err.message, stack: err.stack }) + JSON.stringify({ bucket, path, next, message: err.message, stack: err.stack }), ]); return Promise.reject(err); } @@ -95,7 +95,6 @@ module.exports = async function (uri) { return Promise.resolve(file); } } catch (err) { - this.log('error', ['storage.list', JSON.stringify({ uri, message: err.message, stack: err.stack })]); return Promise.reject(err); } }; diff --git a/src/load.js b/src/load.js index 26f65c3..2bcf096 100644 --- a/src/load.js +++ b/src/load.js @@ -76,7 +76,6 @@ module.exports = async function (uri) { return Promise.resolve(file); } } catch (err) { - this.log('error', ['storage.load', JSON.stringify({ uri, message: err.message, stack: err.stack })]); return Promise.reject(err); } }; diff --git a/src/move.js b/src/move.js index 0704d0c..2d814bc 100644 --- a/src/move.js +++ b/src/move.js @@ -58,11 +58,13 @@ module.exports = async function (sourceUri, destinationUri, keepOriginal) { this.log('log', ['storage.move.aws2aws copying >', sourceUri, destinationUri]); // copy file - await this.sdk.s3.copyObject({ - Bucket: bucket, - Key: path, - CopySource: sourceUri.replace('s3://', '/'), - }).promise(); + await this.sdk.s3 + .copyObject({ + Bucket: bucket, + Key: path, + CopySource: sourceUri.replace('s3://', '/'), + }) + .promise(); // move file within gcs if (keepOriginal != true) { @@ -75,10 +77,12 @@ module.exports = async function (sourceUri, destinationUri, keepOriginal) { path = structure.join('/'); // move file - await this.sdk.s3.deleteObject({ - Bucket: bucket, - Key: path, - }).promise(); + await this.sdk.s3 + .deleteObject({ + Bucket: bucket, + Key: path, + }) + .promise(); } // return ok @@ -97,23 +101,17 @@ module.exports = async function (sourceUri, destinationUri, keepOriginal) { if (keepOriginal != true) { await storage.delete(sourceUri); } else { - this.log('log', ['storage.move.any2any not deleting sourceUri >', keepOriginal, sourceUri]); + this.log('log', [ + 'storage.move.any2any not deleting sourceUri >', + keepOriginal, + sourceUri, + ]); } // return ok return Promise.resolve(); } } catch (err) { - this.log('error', [ - 'storage.move', - JSON.stringify({ - sourceUri, - destinationUri, - keepOriginal, - message: err.message, - stack: err.stack, - }), - ]); return Promise.reject(err); } }; diff --git a/src/save.js b/src/save.js index a9f14d7..97f1e94 100644 --- a/src/save.js +++ b/src/save.js @@ -76,18 +76,17 @@ module.exports = async function (uri, buffer) { return Promise.resolve(); } else { // local file - + // log progress this.log('log', ['storage.save.local >', uri]); - + // save file let file = await saveLocalFile(this, uri, buffer); - + // return ok return Promise.resolve(file); } } catch (err) { - this.log('error', ['storage.save', JSON.stringify({ uri, message: err.message, stack: err.stack })]); return Promise.reject(err); } };