js: Use .catch() to simplify error handling

This commit is contained in:
Stein Magnus Jodal 2014-06-17 20:41:35 +02:00
parent 9ed17b222a
commit 198bd8af6c

View File

@ -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) {