js: Use .catch() to simplify error handling
This commit is contained in:
parent
9ed17b222a
commit
198bd8af6c
@ -245,8 +245,8 @@ Mopidy.prototype._handleEvent = function (eventMessage) {
|
||||
|
||||
Mopidy.prototype._getApiSpec = function () {
|
||||
return this._send({method: "core.describe"})
|
||||
.then(this._createApi.bind(this), this._handleWebSocketError)
|
||||
.then(null, this._handleWebSocketError);
|
||||
.then(this._createApi.bind(this))
|
||||
.catch(this._handleWebSocketError);
|
||||
};
|
||||
|
||||
Mopidy.prototype._createApi = function (methods) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user