IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 13, 2006, 3:29:58 PM (19 years ago)
Author:
jhoblitt
Message:

improve error checking in define_camera()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/PS-IPP-Config/lib/PS/IPP/Config.pm

    r10573 r10699  
    11# Copyright (c) 2006  Paul Price, Joshua Hoblitt
    22#
    3 # $Id: Config.pm,v 1.19 2006-12-08 19:58:32 price Exp $
     3# $Id: Config.pm,v 1.20 2006-12-14 01:29:58 jhoblitt Exp $
    44
    55package PS::IPP::Config;
     
    6868    my $camera_list = _mdLookupMD($self->{_ipprc}, 'CAMERAS'); # List of cameras
    6969    my $filename = _mdLookupStr($camera_list, $name); # Filename of camera configuration
     70    croak "Unable to find configuration file for camera $name\n"
     71        if not defined $filename;
     72
    7073    my @path = split /:/, $self->{path}; # List of paths to try
    7174    my $found;                  # Found it?
     
    7780        }
    7881    }
    79     croak "Unable to find camera configuration file $filename\n" if not defined $found;
     82    croak "Unable to find camera configuration file $filename\n"
     83        if not defined $found;
    8084
    8185    # Read the file
     
    8589    $self->{camera} = $parser->parse( join '', @contents); # The parsed metadata config
    8690
     91    # XXX why isn't just $self being returned here? -JH
    8792    return defined $self->{camera};
    8893}
Note: See TracChangeset for help on using the changeset viewer.