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

Exit with the yaml parse error on bad rc files #614

Merged
merged 1 commit into from Nov 21, 2019

Conversation

isaacs
Copy link
Member

@isaacs isaacs commented Nov 12, 2019

Fix #613

@isaacs
Copy link
Member Author

isaacs commented Nov 12, 2019

NB: a missing rcfile is still fine, which does mean you could do tap --rcfile=/this/does/not/exist, which is clearly a user error, but handling that while also not aborting on a missing default taprc file would be a tiny bit more involved.

bin/run.js Outdated
@@ -827,3 +829,10 @@ try {
throw er
}
}

try {
process.on('unhandledRejection', onError)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is new, should process.off be added after the call to jack?

Otherwise this looks fine and I've verified it acts as I expect when .taprc is invalid.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Turns out that removing the handler right after teh call to jack removes it before it can be relevant, because async function.

Updated branch with another approach that seems to work.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Retested with the updated branch, still resolves the issue for me.

@isaacs isaacs merged commit e09d227 into master Nov 21, 2019
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

Successfully merging this pull request may close these issues.

.taprc parse failures should throw an error or at least warn
2 participants