IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 24, 2009, 12:00:25 PM (17 years ago)
Author:
Paul Price
Message:

Adding handling for missed exceptions, similar to register_imfile.pl --- the idea is to have exceptions trigger the my_die functions so that errors are recorded in the database, and don't go on forever.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippScripts/scripts/detrend_reject_exp.pl

    r18562 r22430  
    2727use Getopt::Long qw( GetOptions :config auto_help auto_version gnu_getopt );
    2828use Pod::Usage qw( pod2usage );
     29
     30# Look for programs we need
     31my $missing_tools;
     32my $dettool = can_run('dettool') or (warn "Can't find dettool" and $missing_tools = 1);
     33if ($missing_tools) {
     34    warn("Can't find required tools.");
     35    exit($PS_EXIT_CONFIG_ERROR);
     36}
    2937
    3038my ($det_id, $iter, $det_type, $camera, $outroot, $filter, $dbname, $verbose, $no_update, $no_op, $redirect);
     
    5260    defined $outroot;
    5361
     62# Unhandled exceptions should be passed on to my_die so they get pushed into the database
     63$SIG{__DIE__} = sub { die @_ if $^S;
     64                      my_die( $_[0], $det_id, $iter, $PS_EXIT_UNKNOWN_ERROR ); };
     65
    5466# check for existing directory, generate if needed
    5567$ipprc->outroot_prepare($outroot);
     
    89101my $rejstats = PS::IPP::Metadata::Stats->new($REJSTATS); # Stats parser
    90102
    91 # Look for programs we need
    92 my $missing_tools;
    93 my $dettool = can_run('dettool') or (warn "Can't find dettool" and $missing_tools = 1);
    94 if ($missing_tools) {
    95     warn("Can't find required tools.");
    96     exit($PS_EXIT_CONFIG_ERROR);
    97 }
    98 
    99103# Get list of component files
    100104my ($exposures, $command, $success, $error_code, $full_buf, $stdout_buf, $stderr_buf);
     
    345349        $command .= " -det_id $det_id";
    346350        $command .= " -iteration $iter";
    347         # XXX EAM : we should add this to the db : $command .= " -path_base $outroot";
     351        # XXX EAM : we should add this to the db : $command .= " -path_base $outroot";
    348352        $command .= " -code $exit_code";
    349353        $command .= " -dbname $dbname" if defined $dbname;
Note: See TracChangeset for help on using the changeset viewer.