diff --git a/js/src/mopidy.js b/js/src/mopidy.js index 8586d231..d3036ff5 100644 --- a/js/src/mopidy.js +++ b/js/src/mopidy.js @@ -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) {