From 935d7c15a4523109d3a8cd2b6042b5a1889496cf Mon Sep 17 00:00:00 2001 From: Simon Schick Date: Tue, 8 Dec 2015 22:15:28 +0100 Subject: [PATCH] Do not use process.exit, throw instead --- entrypoint.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/entrypoint.js b/entrypoint.js index 7b6fe8afd..68b8ac400 100644 --- a/entrypoint.js +++ b/entrypoint.js @@ -18,12 +18,13 @@ var major = parseInt(v[0]), patch = parseInt(v[2]); if((major == 0 && minor < 12) || (major == 0 && minor == 12 && patch < 7)) { - console.log("discord.js doesn't support node versions less than 0.12.7."); - console.log("If you /really/ want to run it on this node (" + - process.version + "), then remove the check from entrypoint.js."); - console.log("However, this is unsupported and WILL cause problems."); - console.log("Exiting now."); - process.exit(1); + if(!env.OVERRIDE_DISCORD_MIN_VERSION) { + throw new Error( + `discord.js doesn't support node versions less than 0.12.7. + If you /really/ want to run it on this node (${process.version}), then set OVERRIDE_DISCORD_MIN_VERSION as enviroment variable. + However, this is unsupported and WILL cause problems`.replace(/\t/g, '') + ) + } } // at the moment no node version has full ES6 support