Skip to content

here is a change that enabled sentry entries to be sent when there is output in the stderr but exit code is still 0 #28

Open
rogersprint wants to merge 2 commits intoYipit:masterfrom
rogersprint:master
Open

here is a change that enabled sentry entries to be sent when there is output in the stderr but exit code is still 0 #28
rogersprint wants to merge 2 commits intoYipit:masterfrom
rogersprint:master

Conversation

@rogersprint
Copy link

No description provided.

@JamesCropcho
Copy link

This seems like it could be useful, and also would not impact preexisting Cron-Sentry installations.

with TemporaryFile() as stderr:
try:
exit_status = call(self.command, stdout=stdout, stderr=stderr)
last_lines_stdout = self._get_last_lines(stdout)
Copy link

Choose a reason for hiding this comment

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

any reason to move the last_lines_stdout and last_lines_stderr lines to inside the try, @rogersprint? The reason they were outside originally is that only call() should be raising CommandNotFoundError.


if exit_status != 0:
self.level = logging.ERROR
self.report(exit_status, last_lines_stdout, last_lines_stderr, elapsed)
Copy link

Choose a reason for hiding this comment

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

won't this report twice if it exits with anything but 0 and has stderr because there's no return exit_status in this if block?

"last_lines_stdout": expected_stdout,
"last_lines_stderr": expected_stderr,
})
'command':mock.ANY,
Copy link

Choose a reason for hiding this comment

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

Could you revert all stylistic changes, please? they are not related to the pull request.

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.

3 participants