Skip to content

Commit

Permalink
improve: show syntax errors in config file
Browse files Browse the repository at this point in the history
Related to #60.
  • Loading branch information
simonhaenisch committed Jan 26, 2020
1 parent 63ddd96 commit ca9fe3d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,12 @@ async function main(args: typeof cliFlags, config: Config) {
pdf_options: { ...config.pdf_options, ...configFile.pdf_options },
};
} catch (error) {
console.warn(chalk.red(`Warning: couldn't read config file: ${args['--config-file']}`));
console.warn(chalk.red(`Warning: couldn't read config file: ${path.resolve(args['--config-file'])}`));

if (args['--debug']) {
console.error(error);
} else if (error instanceof SyntaxError) {
console.error(error.message);
}
}
}
Expand Down

0 comments on commit ca9fe3d

Please sign in to comment.