Changeset 2419


Ignore:
Timestamp:
06/25/20 19:56:19 (4 years ago)
Author:
nanardon
Message:

la-cli: search return an error is object type is unsupported

File:
1 edited

Legend:

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

    r2402 r2419  
    157157            code => sub { 
    158158                my ($self, @args) = @_; 
    159                 if ($_[1]) { 
    160                     my @res = $self->base->search_objects(@args); 
    161                     $self->print(map { "$_\n" } @res); 
    162                     $self->{_lastsearch} = \@res; 
    163                     $self->{_lastsearchtype} = $args[0]; 
     159                if ($args[0]) { 
     160                    if (!$self->base->is_supported_object($args[0])) { 
     161                        $self->print("$args[0] is an usupported object type\n"); 
     162                    } else { 
     163                        my @res = $self->base->search_objects(@args); 
     164                        $self->print(map { "$_\n" } @res); 
     165                        $self->{_lastsearch} = \@res; 
     166                        $self->{_lastsearchtype} = $args[0]; 
     167                    } 
    164168                } else { 
    165169                    $self->print("Object type missing\n"); 
Note: See TracChangeset for help on using the changeset viewer.