Added logic to return error in case Storage get method fails to retrieve text from IPFS
This commit is contained in:
parent
74343ceb60
commit
c9a4a3156d
|
@ -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);
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -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);
|
||||
});
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue