From 5781c45a3dedcf0bd9c22a6cafc0787b363e186a Mon Sep 17 00:00:00 2001 From: Bobby Wibowo Date: Fri, 8 Jan 2021 09:20:00 +0700 Subject: [PATCH] refactor: no throw literal in lolisafe.js --- lolisafe.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lolisafe.js b/lolisafe.js index 799f919..ffc3a93 100644 --- a/lolisafe.js +++ b/lolisafe.js @@ -278,7 +278,8 @@ safe.use('/api', api) // ClamAV scanner if (config.uploads.scan && config.uploads.scan.enabled) { if (!config.uploads.scan.clamOptions) { - throw 'Missing object config.uploads.scan.clamOptions (check config.sample.js)' + logger.error('Missing object config.uploads.scan.clamOptions (check config.sample.js)') + process.exit(1) } utils.clamscan.instance = await new ClamScan().init(config.uploads.scan.clamOptions) utils.clamscan.version = await utils.clamscan.instance.get_version().then(s => s.trim())