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_skycell.pl

    r21371 r22430  
    2626
    2727my $ipprc = PS::IPP::Config->new(); # IPP configuration
     28
     29# Look for programs we need
     30my $missing_tools;
     31my $warptool = can_run('warptool') or (warn "Can't find warptool" and $missing_tools = 1);
     32my $pswarp = can_run('pswarp') or (warn "Can't find pswarp" and $missing_tools = 1);
     33my $ppConfigDump = can_run('ppConfigDump') or (warn "Can't find ppConfigDump" and $missing_tools = 1);
     34my $ppStatsFromMetadata = can_run('ppStatsFromMetadata') or (warn "Can't find ppStatsFromMetadata" and $missing_tools = 1);
     35if ($missing_tools) {
     36    warn("Can't find required tools.");
     37    exit($PS_EXIT_CONFIG_ERROR);
     38}
    2839
    2940my ($warp_id, $skycell_id, $warp_skyfile_id, $tess_dir, $camera, $dbname, $outroot, $threads, $run_state, $verbose, $no_update, $no_op, $redirect, $save_temps);
     
    5768    and defined $run_state;
    5869
     70# Unhandled exceptions should be passed on to my_die so they get pushed into the database
     71$SIG{__DIE__} = sub { die @_ if $^S;
     72                      my_die( $_[0], $warp_id, $skycell_id, $tess_dir, $PS_EXIT_UNKNOWN_ERROR ); };
     73
    5974$ipprc->define_camera($camera);
    6075
     
    6580
    6681my $source_id = $ipprc->source_id($dbname, $PS_TABLE_ID_WARP);
    67 
    68 # Look for programs we need
    69 my $missing_tools;
    70 my $warptool = can_run('warptool') or (warn "Can't find warptool" and $missing_tools = 1);
    71 my $pswarp = can_run('pswarp') or (warn "Can't find pswarp" and $missing_tools = 1);
    72 my $ppConfigDump = can_run('ppConfigDump') or (warn "Can't find ppConfigDump" and $missing_tools = 1);
    73 my $ppStatsFromMetadata = can_run('ppStatsFromMetadata') or (warn "Can't find ppStatsFromMetadata" and $missing_tools = 1);
    74 if ($missing_tools) {
    75     warn("Can't find required tools.");
    76     exit($PS_EXIT_CONFIG_ERROR);
    77 }
    7882
    7983# Get list of component imfiles for exposure
Note: See TracChangeset for help on using the changeset viewer.