From 75cd470fb18a982907dc89056db9fc8fa9ccadbe Mon Sep 17 00:00:00 2001 From: yflory Date: Mon, 21 Aug 2023 16:42:01 +0200 Subject: [PATCH] Fix checkup test when registration is restricted #1185 --- lib/http-commands.js | 1 + www/checkup/main.js | 6 +++--- www/common/outer/http-command.js | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/http-commands.js b/lib/http-commands.js index 229c27e8b..7d8a65182 100644 --- a/lib/http-commands.js +++ b/lib/http-commands.js @@ -287,6 +287,7 @@ var handleResponse = function (Env, req, res) { }); return res.status(500).json({ error: 'Execution error', + errorCode: Util.serializeError(err) }); } res.status(200).json(content); diff --git a/www/checkup/main.js b/www/checkup/main.js index b3ea8204a..3a027ffc6 100644 --- a/www/checkup/main.js +++ b/www/checkup/main.js @@ -359,12 +359,12 @@ define([ Block.writeLoginBlock({ blockKeys: blockKeys, content: {} - }, waitFor(function (e) { + }, waitFor(function (e, obj) { // we should tolerate restricted registration // and proceed to clean up after any data we've created - if (e === 'E_RESTRICTED') { + if (e && obj && obj.errorCode === 'E_RESTRICTED') { restricted = true; - return void cb(true); + return; } if (e) { waitFor.abort(); diff --git a/www/common/outer/http-command.js b/www/common/outer/http-command.js index 8e779bbf9..2f74460a7 100644 --- a/www/common/outer/http-command.js +++ b/www/common/outer/http-command.js @@ -88,7 +88,7 @@ define([ console.error(err); // there might be more info here if (data) { console.error(data); } - return void cb("RESPONSE_REJECTED"); + return void cb("RESPONSE_REJECTED", data); } cb(void 0, data); }));