Changeset 43023
- Timestamp:
- May 19, 2026, 5:01:26 PM (2 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-pstamp-20260421/pstamp/scripts/pstamp_finish.pl
r42981 r43023 137 137 $command .= " -dbname $dbname" if $dbname; 138 138 $command .= " -dbserver $dbserver" if $dbserver; 139 my ( $success, $error_ code, $full_buf, $stdout_buf, $stderr_buf ) =140 run(command => $command, verbose => $verbose);139 my ( $success, $error_msg, $full_buf, $stdout_buf, $stderr_buf ) = run(command => $command, verbose => $verbose); 140 my $error_code = &parse_error_message ($success, $error_msg, $command); 141 141 unless ($success) { 142 142 die("Unable to perform $command error code: $error_code"); … … 260 260 { 261 261 my $command = "$pstamp_results --input $table_def_name --output $outdir/results.fits"; 262 my ( $success, $error_ code, $full_buf, $stdout_buf, $stderr_buf ) =263 run(command => $command, verbose => $verbose);262 my ( $success, $error_msg, $full_buf, $stdout_buf, $stderr_buf ) = run(command => $command, verbose => $verbose); 263 my $error_code = &parse_error_message ($success, $error_msg, $command); 264 264 unless ($success) { 265 265 print STDERR "Unable to perform $command error code: $error_code\n"; 266 $request_fault = $error_code >> 8;266 $request_fault = $error_code; 267 267 } else { 268 268 # dump a textual representation … … 271 271 run(command => $command, verbose => $verbose); 272 272 unless ($success) { 273 $request_fault = $error_code >> 8;273 $request_fault = $error_code; 274 274 my_die("Unable to perform $command error code: $error_code", $req_id, $request_fault); 275 275 } … … 288 288 run(command => $command, verbose => $verbose); 289 289 unless ($success) { 290 $request_fault = $error_code >> 8;290 $request_fault = $error_code; 291 291 my_die("Unable to perform $command error code: $error_code\n", $req_id, $request_fault); 292 292 } … … 505 505 return 40587.0 + ($ticks/86400.); 506 506 } 507 508 # if the program exited normally, the exit value is returned 509 # if the program exited with a signal (abort, crash, etc), PS_EXIT_PROG_ERROR (4) is returned 510 # if the program failed to run, -PS_EXIT_PROG_ERROR (-4) is returned 511 sub parse_error_message { 512 my $success = shift; 513 my $error_msg = shift; 514 my $command = shift; 515 516 if ($success) { return 0; } 517 518 print "raw error_msg: $error_msg\n"; 519 print "full command: $command\n"; 520 521 if (&looks_like_number($error_msg)) { return (($error_msg >> 8) or ($PS_EXIT_PROG_ERROR)); } 522 523 # which of these match? 524 my ($error_code) = $error_msg =~ m/exited with value (\d+)/; 525 if (defined $error_code) { return $error_code; } 526 527 ($error_code) = $error_msg =~ m/died with signal (\d+)/; 528 # if (defined $error_code) { return (128 + $error_code); } 529 if (defined $error_code) { return ($PS_EXIT_PROG_ERROR); } 530 531 # probably failed to execute: 532 return (-1*$PS_EXIT_PROG_ERROR); 533 }
Note:
See TracChangeset
for help on using the changeset viewer.
