Ignore:
Timestamp:
10/07/15 16:48:36 (9 years ago)
Author:
nanardon
Message:

Avoid useless error messages

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Attributes.pm

    r1415 r1416  
    203203    if ($self->{checkinputformat}) { 
    204204        if (!$self->{checkinputformat}->($value)) { 
     205           return; 
     206        } 
     207    } 
     208 
     209    return 1; 
     210} 
     211 
     212=head2 checkinput ($value) 
     213 
     214Check input value, return false on error 
     215 
     216=cut 
     217 
     218sub checkinput { 
     219    my ($self, $values) = @_; 
     220 
     221    foreach my $value (ref $values ? @{ $values } : $values) { 
     222        if (!$self->checkinputformat($value)) { 
    205223            $self->base->log(LA_ERR, "Wrong format for  %s/%s: %s", 
    206224               $self->name, 
    207225               $self->{_otype}, 
    208226               $value 
    209            ); 
    210            return; 
    211         } 
    212     } 
    213  
    214     return 1; 
    215 } 
    216  
    217 =head2 checkinput ($value) 
    218  
    219 Check input value, return false on error 
    220  
    221 =cut 
    222  
    223 sub checkinput { 
    224     my ($self, $values) = @_; 
    225  
    226     foreach my $value (ref $values ? @{ $values } : $values) { 
    227         if (!$self->checkinputformat($value)) { 
     227            ); 
    228228            return; 
    229229        } 
Note: See TracChangeset for help on using the changeset viewer.