1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-06-16 02:19:55 +00:00

AWS Plugin: improved error handling

This commit is contained in:
Jermolene 2017-09-07 10:55:42 +01:00
parent 51b1ead5c9
commit 5a5d648127

View File

@ -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;