Add error handling to lbry.resolveName() and lbry.publish()
This commit is contained in:
parent
2ec8a5c7fc
commit
c46aecfbd9
1 changed files with 13 additions and 2 deletions
15
js/lbry.js
15
js/lbry.js
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue