RunCommandLogs: add a helper for if it failed with an exec error

This commit is contained in:
Graham Christensen
2021-11-19 14:17:20 -05:00
parent d849856dcd
commit a7aeb766aa
3 changed files with 29 additions and 0 deletions

View File

@ -297,5 +297,27 @@ sub did_fail_with_signal {
return defined($self->signal);
}
=head2 did_fail_with_exec_error
Looks in the database to see if the task failed with a signal.
Return:
* true if the task is not running and failed with a signal.
* false if the task is running or exited with an exit code.
=cut
sub did_fail_with_exec_error {
my ($self) = @_;
if ($self->is_running()) {
return 0;
}
if ($self->did_succeed()) {
return 0;
}
return defined($self->error_number);
}
1;