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

DuH Validate Returns Zero Exit Code on Validation Failure #86

Open
seldridge opened this issue Nov 9, 2020 · 1 comment
Open

DuH Validate Returns Zero Exit Code on Validation Failure #86

seldridge opened this issue Nov 9, 2020 · 1 comment

Comments

@seldridge
Copy link
Member

Currently (on my system of Node v12.18.0 and DuH 1.18.2), if you have a duh validate failure, you get a zero exit code with some information about promise rejections being deprecated:

(node:46744) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:46744) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

If duh validate fails, it should return a non-zero exit code (preferably something sane like 1).

I can't speak to how this should be handled, but adding the --unhandled-rejections=strict option inside duh.js' shebang will cause the exit code to change to 1 for me.

@seldridge
Copy link
Member Author

It looks like Node 15 is the first version that will return a non-zero exit code without setting the --unhandled-rejections=strict option.

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