show all of create rest user command output on failure

pull/21833/head
Bruno Windels 2019-04-09 15:30:20 +02:00
parent d1df0d98c6
commit 4591b26dab
1 changed files with 4 additions and 4 deletions

View File

@ -59,10 +59,10 @@ module.exports = class RestSessionCreator {
try { try {
await exec(allCmds, {cwd: this.cwd, encoding: 'utf-8'}); await exec(allCmds, {cwd: this.cwd, encoding: 'utf-8'});
} catch (result) { } catch (result) {
const lines = result.stdout.trim().split('\n'); // const lines = result.stdout.trim().split('\n');
const failureReason = lines[lines.length - 1]; // const failureReason = lines[lines.length - 1];
const logs = (await exec("tail -n 100 synapse/installations/consent/homeserver.log")).stdout; // const logs = (await exec("tail -n 100 synapse/installations/consent/homeserver.log")).stdout;
throw new Error(`creating user ${username} failed: ${failureReason}, synapse logs:\n${logs}`); throw new Error(`creating user ${username} failed, script output:\n ${result.stdout.trim()}`);
} }
} }