From 198bd8af6c5990f27e82cdcd4f6c3995bbf3d67d Mon Sep 17 00:00:00 2001 From: Stein Magnus Jodal Date: Tue, 17 Jun 2014 20:41:35 +0200 Subject: [PATCH] js: Use .catch() to simplify error handling --- js/src/mopidy.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) {