Added logic to return error in case Storage get method fails to retrieve text from IPFS

This commit is contained in:
Andy Nogueira 2017-03-12 18:19:56 -04:00
parent 74343ceb60
commit c9a4a3156d
2 changed files with 4 additions and 0 deletions

View File

@ -290,6 +290,8 @@ EmbarkJS.Storage.get = function(hash) {
var promise = new Promise(function(resolve, reject) {
self.ipfsConnection.object.get([hash]).then(function(node) {
resolve(node.data);
}).catch(function (err){
reject(err);
});
});

View File

@ -217,6 +217,8 @@ EmbarkJS.Storage.get = function(hash) {
var promise = new Promise(function(resolve, reject) {
self.ipfsConnection.object.get([hash]).then(function(node) {
resolve(node.data);
}).catch(function (err){
reject(err);
});
});