From 5a5d6481278dd73e3105df8268fa4f817009f2aa Mon Sep 17 00:00:00 2001 From: Jermolene Date: Thu, 7 Sep 2017 10:55:42 +0100 Subject: [PATCH] AWS Plugin: improved error handling --- plugins/tiddlywiki/aws/modules/utils.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugins/tiddlywiki/aws/modules/utils.js b/plugins/tiddlywiki/aws/modules/utils.js index 351290b4a..68fa7185b 100644 --- a/plugins/tiddlywiki/aws/modules/utils.js +++ b/plugins/tiddlywiki/aws/modules/utils.js @@ -62,7 +62,12 @@ function putFile(region,bucketName,title,text,type,callback) { Body: new Buffer(text,encoding), ContentType: type || "text/plain" }; - s3bucket.upload(params,callback); + s3bucket.upload(params,function(err,data) { + if(err) { + return callback(err + " (writing " + title + " to " + bucketName + ", type " + type + ")"); + } + callback(null,data); + }); } exports.putFile = putFile;