Skip to content

Commit

Permalink
Replace return with throw
Browse files Browse the repository at this point in the history
  • Loading branch information
jamiebuilds committed Feb 5, 2018
1 parent 081b454 commit ab568a5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function startupError(messageKey, ...args) {
const message = Lang.get(messageKey, ...args);
console.error(chalk.red.bold(message));
process.exit(1);
throw new Error(message);
return new Error(message);
}

export default async function glow(opts: GlowOptions) {
Expand All @@ -29,14 +29,14 @@ export default async function glow(opts: GlowOptions) {
let flowConfigPath = await flow.getFlowConfigPath(cwd);

if (!flowConfigPath) {
return startupError('noFlowConfig');
throw startupError('noFlowConfig');
}

let flowRootDir = flow.getFlowRootDir(flowConfigPath);
let flowConfig = await flow.getFlowConfig(flowRootDir);

if (!flowConfig) {
return startupError(
throw startupError(
'noFlowBinary',
flow.getPossibleFlowBinPaths(flowRootDir).join(', ')
);
Expand Down

0 comments on commit ab568a5

Please sign in to comment.