Add error handling to lbry.resolveName() and lbry.publish()

This commit is contained in:
Alex Liebowitz 2016-07-15 08:01:51 -04:00
parent 2ec8a5c7fc
commit c46aecfbd9

View file

@ -108,8 +108,11 @@ lbry.search = function(query, callback)
lbry.call("search_nametrie", { "search": query }, callback);
}
lbry.resolveName = function(name, callback, ec) {
lbry.call('resolve_name', { 'name': name }, callback);
lbry.resolveName = function(name, callback) {
lbry.call('resolve_name', { 'name': name }, callback, () => {
// For now, assume any error means the name was not resolved
callback(null);
});
}
lbry.getStream = function(name, callback) {
@ -151,6 +154,14 @@ lbry.revealFile = function(path, callback) {
lbry.call('reveal', { path: path }, callback);
}
lbry.publish = function(params, callback, errorCallback) {
// Use ES6 named arguments instead of directly passing param dict?
lbry.call('publish', params, callback, () => {
// Change this to return error message or failure code
callback(null);
});
}
lbry.publish = function(params, callback) {
// Use ES6 named arguments instead of directly passing param dict?
lbry.call('publish', params, callback);