| 1 | package OpenInteract2::Exception::Parameter; | ||||||||||
| 2 | |||||||||||
| 3 | # $Id: Parameter.pm,v 1.7 2005/03/17 14:58:02 sjn Exp $ | ||||||||||
| 4 | |||||||||||
| 5 | 87 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 87 | ▶ | use base qw( OpenInteract2::Exception Class::Accessor::Fast ); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | 87 | $OpenInteract2::Exception::Parameter::VERSION = sprintf("%d.%02d", q$Revision: 1.7 $ =~ /(\d+)\.(\d+)/); | |||||||||
| 9 | |||||||||||
| 10 | 87 | my @FIELDS = qw( parameter_fail ); | |||||||||
| 11 | 87 | OpenInteract2::Exception::Parameter->mk_accessors( @FIELDS ); | |||||||||
| 12 | 4 | ▶ | sub Fields { return @FIELDS } | ||||||||
|
Subroutine
Fields: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 13 | |||||||||||
| 14 | 4 | ▶ | sub full_message { | ||||||||
|
Subroutine
full_message: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||
| 15 | 4 | my ( $self ) = @_; | |||||||||
| 16 | 4 | my $failures = $self->parameter_fail; | |||||||||
| 17 | 4 | my @errors = (); | |||||||||
| 18 | 4 | foreach my $field ( sort keys %{ $failures } ) { | |||||||||
| 19 | my $field_msg = ( ref $failures->{ $field } eq 'ARRAY' ) | ||||||||||
| 20 | 1 | ? join( '; ', @{ $failures->{ $field } } ) | |||||||||
| 21 | 5 | ▶ | : $failures->{ $field }; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 22 | 5 | push @errors, "$field: $field_msg"; | |||||||||
| 23 | } | ||||||||||
| 24 | 4 | return "One or more parameters were not valid: " . join( ' ;; ', @errors ); | |||||||||
| 25 | } | ||||||||||
| 26 | |||||||||||
| 27 | 87 | 1; | |||||||||
| 28 | |||||||||||
| 29 | __END__ | ||||||||||