[tools] testbot/cgi: Use AddError() to report collection block errors.

Francois Gouget fgouget at codeweavers.com
Thu Jul 7 08:11:27 CDT 2022


Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
---
 testbot/lib/ObjectModel/CGI/CollectionBlock.pm | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/testbot/lib/ObjectModel/CGI/CollectionBlock.pm b/testbot/lib/ObjectModel/CGI/CollectionBlock.pm
index 0f0a3bd6bb..bbff74c6b3 100644
--- a/testbot/lib/ObjectModel/CGI/CollectionBlock.pm
+++ b/testbot/lib/ObjectModel/CGI/CollectionBlock.pm
@@ -600,16 +600,10 @@ sub OnItemAction($$$)
 
   if ($self->{RW} and $Action eq "Delete")
   {
-    my $ErrMessage = $self->{Collection}->DeleteItem($Item);
-    if (defined $ErrMessage)
-    {
-      $self->{EnclosingPage}->SetError(undef, $ErrMessage);
-      return 0;
-    }
-    return 1;
+    return $self->{EnclosingPage}->AddError($self->{Collection}->DeleteItem($Item)) ? 0 : 1;
   }
 
-  $self->{EnclosingPage}->SetError(undef, "No per-Item action defined for $Action");
+  $self->{EnclosingPage}->AddError("No per-Item action defined for $Action");
   return 0;
 }
 
-- 
2.30.2




More information about the wine-devel mailing list