Re: Structured exception information
- From: Robert A Duff <bobduff@xxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 15 Jan 2007 12:28:14 -0500
Maciej Sobczak <no.spam@xxxxxxxxxxx> writes:
If there are problems during the execution of the constructor function,
the exception is raised, so that there is no X object in a bad state.
How can I pass some error information from the constructor function out,
so that it's used when the exception is handled?
There is no good way to do this in Ada. You can attach any information
you like to an exception, if you are willing to encode it as a String --
but then you lose static type checking. You can put the info in a
global variable, but that's bad for several reasons (not task safe,
can be accessed outside of any handler, ...). You can put the info in a
Task_Attribute, but that's rather a pain -- verbose and inefficient.
- Bob
.
- Follow-Ups:
- Re: Structured exception information
- From: Georg Bauhaus
- Re: Structured exception information
- References:
- Structured exception information
- From: Maciej Sobczak
- Structured exception information
- Prev by Date: Re: Structured exception information
- Next by Date: Re: Structured exception information
- Previous by thread: Re: Structured exception information
- Next by thread: Re: Structured exception information
- Index(es):
Relevant Pages
|