From ae7c24a9201c03f53e80981ffbb8de97fb265b8c Mon Sep 17 00:00:00 2001 From: Mario Pizzinini Date: Wed, 19 Oct 2016 18:03:13 +0200 Subject: [PATCH] Added a comment to explain why catch is suppressed. --- src/cli/commands/clean.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/cli/commands/clean.js b/src/cli/commands/clean.js index 203b6e7d69..f420b3d489 100644 --- a/src/cli/commands/clean.js +++ b/src/cli/commands/clean.js @@ -121,8 +121,11 @@ export async function run( ): Promise { reporter.step(1, 2, reporter.lang('cleanCreatingFile', CLEAN_FILENAME)); try { - await fs.writeFile(path.join(config.cwd, CLEAN_FILENAME), '\n', {flag: 'wx'}); - } catch (e) {} + await fs.writeFile(path.join(config.cwd, CLEAN_FILENAME), '\n', {flag: 'wx'}); + } catch (e) { + // The file exists and can not be replaced. + // Catch is suppressed, because this error does not reflect a problem. + } reporter.step(2, 2, reporter.lang('cleaning')); const {removedFiles, removedSize} = await clean(config, reporter);