[tools] testbot/web: Use AddError() in the job details page.

Francois Gouget fgouget at codeweavers.com
Thu Jul 7 08:12:29 CDT 2022


Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
---
 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 6d3f13cd04..3fbdb427e6 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
-- 
2.30.2




More information about the wine-devel mailing list