mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-06-24 22:33:16 +00:00
AWS Plugin: improved error handling
This commit is contained in:
parent
51b1ead5c9
commit
5a5d648127
|
@ -62,7 +62,12 @@ function putFile(region,bucketName,title,text,type,callback) {
|
||||||
Body: new Buffer(text,encoding),
|
Body: new Buffer(text,encoding),
|
||||||
ContentType: type || "text/plain"
|
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;
|
exports.putFile = putFile;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user