From dda51f2801231227b106b71389ace5147b978505 Mon Sep 17 00:00:00 2001 From: Julien Fontanet Date: Wed, 4 Mar 2015 15:01:30 +0100 Subject: [PATCH] Xo::call() should never through synchronously. --- packages/xo-lib/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/xo-lib/index.js b/packages/xo-lib/index.js index 725c60007..abec8f8b7 100644 --- a/packages/xo-lib/index.js +++ b/packages/xo-lib/index.js @@ -358,7 +358,9 @@ Xo.prototype.call = function (method, params) { // Prevent session.*() from being because it may interfere // with this class session management. if (startsWith(method, 'session.')) { - throw new Error('session.*() methods are disabled from this interface'); + return Bluebird.reject( + new Error('session.*() methods are disabled from this interface') + ); } return this._session.bind(this).then(function () {