--- loncom/Attic/lonc 2000/12/05 03:23:59 1.8 +++ loncom/Attic/lonc 2000/12/05 16:51:41 1.9 @@ -25,6 +25,27 @@ use Fcntl; use Tie::RefHash; use Crypt::IDEA; +# grabs exception and records it to log before exiting +sub catchexception { + my ($signal)=@_; + &logthis("CRITICAL: " + ."ABNORMAL EXIT. Child $$ for server $wasserver died through " + ."$signal with this parameter->[$@]"); + die($@); +} + +# grabs exception and records it to log before exiting +# NOTE: we must NOT use the regular (non-overrided) die function in +# the code because a handler CANNOT be attached to it +# (despite what some of the documentation says about SIG{__DIE__}. +sub catchdie { + my ($message)=@_; + &logthis("CRITICAL: " + ."ABNORMAL EXIT. Child $$ for server $wasserver died through " + ."\_\_DIE\_\_ with this parameter->[$message]"); + die($message); +} + $childmaxattempts=10; # -------------------------------- Set signal handlers to record abnormal exits @@ -507,24 +528,3 @@ sub nonblock { or catchdie "Can't make socket nonblocking: $!\n"; } -# grabs exception and records it to log before exiting -sub catchexception { - my ($signal)=@_; - &logthis("CRITICAL: " - ."ABNORMAL EXIT. Child $$ for server $wasserver died through " - ."$signal with this parameter->[$@]"); - die($@); -} - -# grabs exception and records it to log before exiting -# NOTE: we must NOT use the regular (non-overrided) die function in -# the code because a handler CANNOT be attached to it -# (despite what some of the documentation says about SIG{__DIE__}. -sub catchdie { - my ($message)=@_; - &logthis("CRITICAL: " - ."ABNORMAL EXIT. Child $$ for server $wasserver died through " - ."\_\_DIE\_\_ with this parameter->[$message]"); - die($message); -} -