Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

process.exit(1) makes it hard to use node-elm-compiler via require() #68

Closed
kachkaev opened this issue Apr 27, 2018 · 0 comments
Closed

Comments

@kachkaev
Copy link

It'd be great a call to process.exit(1) was removed to make it possible to use the module via require()

node-elm-compiler/index.js

Lines 96 to 105 in 40c832b

try {
return runCompiler(sources, optionsWithDefaults, pathToMake)
.on('error', function(err) {
handleError(pathToMake, err);
process.exit(1);
});
} catch (err) {
handleCompilerError(err, pathToMake);
}

There is another occurrence of this method, but the line is never reached:

function handleCompilerError(err, pathToMake) {
if ((typeof err === "object") && (typeof err.code === "string")) {
handleError(pathToMake, err);
} else {
console.error("Exception thrown when attempting to run Elm compiler " + JSON.stringify(pathToMake) + ":\n" + err);
}
throw err;
process.exit(1);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant