aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Reaction/UI/ViewPort/Object.pm
diff options
context:
space:
mode:
authormatthewt <matthewt@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7>2008-01-29 07:39:49 +0000
committermatthewt <matthewt@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7>2008-01-29 07:39:49 +0000
commit2c36a66ba17f92fb468ec386a2433da066388cb1 (patch)
treef97931c9ae141a8a0248097cc4517983a471d19c /lib/Reaction/UI/ViewPort/Object.pm
parentcf1dfeb53b41dc1de820c99077cab40291a268ae (diff)
downloadreaction-2c36a66ba17f92fb468ec386a2433da066388cb1.tar.gz
reaction-2c36a66ba17f92fb468ec386a2433da066388cb1.zip
better error reporting on reflection failure for Object viewport
Diffstat (limited to 'lib/Reaction/UI/ViewPort/Object.pm')
-rw-r--r--lib/Reaction/UI/ViewPort/Object.pm7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/Reaction/UI/ViewPort/Object.pm b/lib/Reaction/UI/ViewPort/Object.pm
index 5cd8e5c..aa372d2 100644
--- a/lib/Reaction/UI/ViewPort/Object.pm
+++ b/lib/Reaction/UI/ViewPort/Object.pm
@@ -74,11 +74,13 @@ class Object is 'Reaction::UI::ViewPort', which {
my $constraint = $attr->type_constraint;
my $base_name = $constraint->name;
my $tried_isa = 0;
+ my @tried;
CONSTRAINT: while (defined($constraint)) {
my $name = $constraint->name;
$name = $attr->_isa_metadata if($name eq '__ANON__');
if (eval { $name->can('meta') } && !$tried_isa++) {
foreach my $class ($name->meta->class_precedence_list) {
+ push(@tried, $class);
my $mangled_name = $class;
$mangled_name =~ s/:+/_/g;
my $builder = "_build_fields_for_type_${mangled_name}";
@@ -86,6 +88,7 @@ class Object is 'Reaction::UI::ViewPort', which {
}
}
if (defined($name)) {
+ push(@tried, $name);
unless (defined($base_name)) {
$base_name = "(anon subtype of ${name})";
}
@@ -97,7 +100,9 @@ class Object is 'Reaction::UI::ViewPort', which {
$constraint = $constraint->parent;
}
if (!defined($constraint)) {
- confess "Can't build field ${attr_name} of type ${base_name} without $builder method or _build_fields_for_type_<type> method for type or any supertype";
+ confess "Can't build field ${attr_name} of type ${base_name} without "
+ ."$builder method or _build_fields_for_type_<type> method "
+ ."for type or any supertype (tried ".join(', ', @tried).")";
}
} else {
confess "Can't build field ${attr} without $builder method or type constraint";