Francois Gouget : testbot/cgi: Use AddError() to report collection block errors.
Alexandre Julliard
julliard at winehq.org
Thu Jul 7 16:53:25 CDT 2022
Module: tools
Branch: master
Commit: 89c70785d318d262a6316da97fb56ee0c7ad5cc2
URL: https://source.winehq.org/git/tools.git/?a=commit;h=89c70785d318d262a6316da97fb56ee0c7ad5cc2
Author: Francois Gouget <fgouget at codeweavers.com>
Date: Thu Jul 7 15:11:27 2022 +0200
testbot/cgi: Use AddError() to report collection block errors.
Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
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 0f0a3bd6..bbff74c6 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;
}
More information about the wine-cvs
mailing list