Re: Structured exception information
- From: Maciej Sobczak <no.spam@xxxxxxxxxxx>
- Date: Tue, 16 Jan 2007 15:33:53 +0100
Stephen Leake wrote:
How can I pass some error information from the constructor function
out, so that it's used when the exception is handled?
Why do you want to?
So that the handler has more information about the error?
Generally, all you can do is report the error to
the user.
That's what I want to do.
Can you give a detailed example of passing more complex information
that is actually used?
Imagine a constructor function that calls a database or a script engine with the query/script provided as a parameter. Some error can result and I want to raise an exception. The handler might benefit (even if for the purpose of presenting a nice error pop-up message) from:
- error code
- error message
- line number
- character position
- hint from the engine
- timestamp from within the engine
- ...
Another example - imagine that your compiler just prints "COMPILER_ERROR" instead of everything that it actually prints.
That wouldn't be very funny!
--
Maciej Sobczak : http://www.msobczak.com/
Programming : http://www.msobczak.com/prog/
.
- Follow-Ups:
- Re: Structured exception information
- From: Stephen Leake
- Re: Structured exception information
- From: Jeffrey Carter
- Re: Structured exception information
- From: Georg Bauhaus
- Re: Structured exception information
- References:
- Structured exception information
- From: Maciej Sobczak
- Re: Structured exception information
- From: Stephen Leake
- Structured exception information
- Prev by Date: Re: Cannot initialize entities of limited type?
- 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
|