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/warp_overlap.pl

    r20655 r22430  
    2525
    2626my $ipprc = PS::IPP::Config->new(); # IPP configuration
     27
     28# Look for programs we need
     29my $missing_tools;
     30my $warptool = can_run('warptool') or (warn "Can't find warptool" and $missing_tools = 1);
     31my $dvoImageOverlaps = can_run('dvoImageOverlaps') or (warn "Can't find dvoImageOverlaps" and $missing_tools = 1);
     32my $ppConfigDump = can_run('ppConfigDump') or (warn "Can't find ppConfigDump" and $missing_tools = 1);
     33if ($missing_tools) {
     34    warn("Can't find required tools.");
     35    exit($PS_EXIT_CONFIG_ERROR);
     36}
    2737
    2838my ($warp_id, $camera, $tess_dir, $dbname, $verbose, $no_update, $no_op, $logfile, $save_temps);
     
    4959    and defined $tess_dir;
    5060
     61# Unhandled exceptions should be passed on to my_die so they get pushed into the database
     62$SIG{__DIE__} = sub { die @_ if $^S;
     63                      my_die( $_[0], $warp_id, $PS_EXIT_UNKNOWN_ERROR ); };
     64
    5165$ipprc->define_camera($camera);
    52 
    53 # Look for programs we need
    54 my $missing_tools;
    55 my $warptool = can_run('warptool') or (warn "Can't find warptool" and $missing_tools = 1);
    56 my $dvoImageOverlaps = can_run('dvoImageOverlaps') or (warn "Can't find dvoImageOverlaps" and $missing_tools = 1);
    57 my $ppConfigDump = can_run('ppConfigDump') or (warn "Can't find ppConfigDump" and $missing_tools = 1);
    58 if ($missing_tools) {
    59     warn("Can't find required tools.");
    60     exit($PS_EXIT_CONFIG_ERROR);
    61 }
    6266
    6367&my_die("Tessellation identifier not provided: $tess_dir", $warp_id, $PS_EXIT_SYS_ERROR) unless $tess_dir ne "NULL";
Note: See TracChangeset for help on using the changeset viewer.