testbot/lib: Improve Collection::Validate()'s error reporting.
Francois Gouget
fgouget at codeweavers.com
Thu Jun 12 03:15:51 CDT 2014
The error message contains no information about the Collection so it should mention the guilty Item's full key.
---
testbot/lib/ObjectModel/Collection.pm | 5 +++--
testbot/lib/ObjectModel/Item.pm | 3 +--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/testbot/lib/ObjectModel/Collection.pm b/testbot/lib/ObjectModel/Collection.pm
index 0070c57..53ad5fe 100644
--- a/testbot/lib/ObjectModel/Collection.pm
+++ b/testbot/lib/ObjectModel/Collection.pm
@@ -404,7 +404,8 @@ sub Validate
(my $ErrProperty, my $ErrMessage) = $Item->Validate();
if (defined($ErrMessage))
{
- return ($Item->GetKey(), $ErrProperty, $ErrMessage);
+ return ($Item->GetKey(), $ErrProperty, "$ErrMessage for " .
+ $self->GetItemName() . " " . $Item->GetFullKey());
}
if ($Item->GetIsNew())
{
@@ -424,7 +425,7 @@ sub Validate
my $ExistingItem = $self->GetBackEnd()->LoadItem($self, $Item->GetKey());
if (defined($ExistingItem))
{
- $ErrMessage = $self->GetItemName() . " " . $ErrMessage .
+ $ErrMessage = $self->GetItemName() . " " . $Item->GetFullKey() .
" already exists";
return ($Item->GetKey(), undef, $ErrMessage);
}
diff --git a/testbot/lib/ObjectModel/Item.pm b/testbot/lib/ObjectModel/Item.pm
index 0cc07ab..2ec69f1 100644
--- a/testbot/lib/ObjectModel/Item.pm
+++ b/testbot/lib/ObjectModel/Item.pm
@@ -382,8 +382,7 @@ sub Validate
my ($ErrKey, $ErrProperty, $ErrMessage) = $Detail->Validate();
if (defined($ErrMessage))
{
- return (undef, $ErrMessage . " for " . $Detail->GetItemName() .
- $ErrKey);
+ return (undef, $ErrMessage);
}
}
}
--
2.0.0
More information about the wine-patches
mailing list