Module: tools Branch: master Commit: 8087405e341b2cb9a1fbff430e4a69c210f6f1c3 URL: https://source.winehq.org/git/tools.git/?a=commit;h=8087405e341b2cb9a1fbff43...
Author: Francois Gouget fgouget@codeweavers.com Date: Thu Jul 7 15:12:29 2022 +0200
testbot/web: Use AddError() in the job details page.
Signed-off-by: Francois Gouget fgouget@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
testbot/web/JobDetails.pl | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-)
diff --git a/testbot/web/JobDetails.pl b/testbot/web/JobDetails.pl index 6d3f13cd..3fbdb427 100644 --- a/testbot/web/JobDetails.pl +++ b/testbot/web/JobDetails.pl @@ -185,20 +185,10 @@ sub OnJobControl($$) { my ($self, $Action) = @_;
- my $ErrMessage = $self->CanDoJobControl($Action); - if (defined $ErrMessage) - { - $self->{EnclosingPage}->SetError(undef, $ErrMessage); - return !1; - } + return !1 if ($self->{EnclosingPage}->AddError($self->CanDoJobControl($Action)));
my $JobId = $self->{EnclosingPage}->GetJob()->Id; - $ErrMessage = JobControl($Action, $JobId); - if (defined $ErrMessage) - { - $self->{EnclosingPage}->SetError(undef, $ErrMessage); - return !1; - } + return !1 if ($self->{EnclosingPage}->AddError(JobControl($Action, $JobId)));
# Ideally this would use something like GetMoreInfoLink() to rebuild a Get # URL to preserve which logs and screenshots have been expanded. But if the