Errors When Using Command Option Not Reflected to Caller #113
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When using the "command" option to run scripts like npm that fail, the error does not get propagated back to the calling process. This fix catches those errors and re-emits them.
Errors from test case on current code:
♢ forever-monitor/monitor/simple
(node) util.print is deprecated. Use console.log instead.
✗ Errored » callback not fired
in attempting to start a command where the path and file do not exist
in forever-monitor/monitor/simple
in test/monitor/simple-test.js
✗ Errored » callback not fired
in When using forever-monitor an instance of Monitor with valid options
in forever-monitor/monitor/simple
in test/monitor/simple-test.js
✗ Errored » callback not fired
in When using forever-monitor running error-on-timer sample three times
in forever-monitor/monitor/simple
in test/monitor/simple-test.js
✗ Errored » callback not fired
in When using forever-monitor running error-on-timer sample once
in forever-monitor/monitor/simple
in test/monitor/simple-test.js
✗ Errored » callback not fired
in When using forever-monitor non-node usage with a perl one-liner
in forever-monitor/monitor/simple
in test/monitor/simple-test.js
✗ Errored » callback not fired
in When using forever-monitor passing node flags through command
in forever-monitor/monitor/simple
in test/monitor/simple-test.js
✗ Errored » callback not fired
in When using forever-monitor attempting to start a script that doesn't exist
in forever-monitor/monitor/simple
in test/monitor/simple-test.js
✗ Errored » callback not fired
in When using forever-monitor attempting to start a command with node in the name
in forever-monitor/monitor/simple
in test/monitor/simple-test.js
Successful test after the fix:
♢ forever-monitor/monitor/simple
attempting to start a command where the path and file do not exist
✓ should throw an error about the invalid file
When using forever-monitor an instance of Monitor with valid options
✓ should have correct properties set
When using forever-monitor attempting to start a script that doesn't exist
✓ should throw an error about the invalid file
When using forever-monitor non-node usage with a perl one-liner
✓ should get back moo
When using forever-monitor an instance of Monitor with valid options calling the restart() method in less than minUptime
✓ should restart the child process
When using forever-monitor passing node flags through command
✓ should get back function
When using forever-monitor attempting to start a command with node in the name
✓ should run the script
When using forever-monitor running error-on-timer sample once
✓ should emit 'exit' when completed
When using forever-monitor running error-on-timer sample three times
✓ should emit 'exit' when completed