comp.lang.ada
 help / color / mirror / Atom feed
From: Jeffrey Carter <jrcarter@acm.org>
Subject: Re: Newbie with a question
Date: Sat, 28 Apr 2001 18:10:58 GMT
Date: 2001-04-28T18:10:58+00:00	[thread overview]
Message-ID: <3AEB07A8.62A218D1@acm.org> (raw)
In-Reply-To: 3AE9E89C.5B6909E1@lmco.com

Paul Storm wrote:
> 
> if ( Type_Is_Buffer and not Buffer_Found ) then
> 
>   Log_Error
>           (
>            Source            => Source,
>            Message           => "Put message here about missing buffer
> size" ,
>            Verbosity         => Default_Verbosity
>           ) ;
> 
>   raise Data_Point_Buffer_Size_Needed_Error ;
> 
> end if;
> 
> <end code>
> 
> If this section of code runs the exception is raised and execution
> abends.
> But the message is not put into the log.  Which should be done by the
> Log_Error call.
> 
> The Log_Error procedure is legacy code and works fine elsewhere in the
> program.

Program termination due to an unhandled exception is not really
abnormal. The Ada runtime should terminate the program normally when an
unhandled exception is raised.

However, what that means differs on different systems. On many desktop
and workstation systems, the runtime will close any open files before
terminating, but on some real-time systems this won't happen. Possibly
writing to the log is buffered and the buffer is not being written
before the program terminates. You can test this by handling the
exception at the top level and closing the log file before reraising the
exception, or by closing the log file before raising the exception.

It's also possible that your verbosity level results in the message not
being put in the log.

-- 
Jeff Carter
"You brightly-colored, mealy-templed, cranberry-smelling, electric
donkey-bottom biters."
Monty Python & the Holy Grail



      parent reply	other threads:[~2001-04-28 18:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-04-27 21:46 Newbie with a question Paul Storm
2001-04-28  3:56 ` Peter Richtmyer
2001-04-28 18:10 ` Jeffrey Carter [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox