Skip to content

Commit

Permalink
Added a comment to explain why catch is suppressed.
Browse files Browse the repository at this point in the history
  • Loading branch information
craftedsystems authored and bestander committed Oct 19, 2016
1 parent 5890b9c commit ae7c24a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/cli/commands/clean.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,11 @@ export async function run(
): Promise<void> {
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);
Expand Down

0 comments on commit ae7c24a

Please sign in to comment.