Changeset 80

Show
Ignore:
Timestamp:
10/16/06 21:28:52 (7 years ago)
Author:
max
Message:

Fixed die to display text and line number.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • shepherd

    r79 r80  
    15211521sub my_die { 
    15221522    my ($arg,@rest) = @_; 
    1523     my ($pack,$file,$line,$sub) = caller(1); 
     1523    my ($pack,$file,$line,$sub) = caller(0); 
    15241524 
    15251525    # check if we are in an eval() 
     
    15271527        printf STDERR "  shepherd caught a die() within eval{} from file $file line $line\n"; 
    15281528    } else { 
    1529         if (!ref($arg)) { 
    1530             printf STDERR "DIE at line %d in file %s\n",$line,$file; 
    1531             CORE::die(join("",@rest)); 
    1532         } else { 
    1533             CORE::die($arg,@rest); 
    1534         } 
    1535     } 
    1536 } 
    1537  
     1529            printf STDERR "\nDIE: line %d in file %s\n",$line,$file; 
     1530            if ($arg) { 
     1531                CORE::die($arg,@rest); 
     1532            } else { 
     1533                CORE::die(join("",@rest)); 
     1534            } 
     1535    } 
     1536} 
     1537