diff options
author | matthewt <matthewt@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7> | 2008-08-04 13:46:54 +0000 |
---|---|---|
committer | matthewt <matthewt@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7> | 2008-08-04 13:46:54 +0000 |
commit | d4c952a697e29ae19f516a278b2b617191da00e2 (patch) | |
tree | 6bad88decf31a0f5b8ba16e7fbf4cbe21cc6ec8d /lib/Reaction/InterfaceModel | |
parent | b0c3f1b1c83e66026d3ee33cbd65fc5547fd2d8c (diff) | |
download | reaction-d4c952a697e29ae19f516a278b2b617191da00e2.tar.gz reaction-d4c952a697e29ae19f516a278b2b617191da00e2.zip |
better error when no predicate for required attribute
Diffstat (limited to 'lib/Reaction/InterfaceModel')
-rw-r--r-- | lib/Reaction/InterfaceModel/Action.pm | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/Reaction/InterfaceModel/Action.pm b/lib/Reaction/InterfaceModel/Action.pm index 70eb0d1..0074b02 100644 --- a/lib/Reaction/InterfaceModel/Action.pm +++ b/lib/Reaction/InterfaceModel/Action.pm @@ -33,6 +33,8 @@ sub can_apply { foreach my $attr ($self->parameter_attributes) { my $predicate = $attr->get_predicate_method; if ($self->attribute_is_required($attr)) { + confess "No predicate for required attribute ${\$attr->name} for ${self}" + unless $predicate; return 0 unless $self->$predicate; } if ($attr->has_valid_values) { |