Re: Structured exception information
- From: Maciej Sobczak <no.spam@xxxxxxxxxxx>
- Date: Wed, 17 Jan 2007 15:05:10 +0100
Stephen Leake wrote:
Generally, all you can do is report the error toThat's what I want to do.
the user.
Then what's wrong with a string?
Doesn't feel as type-safe as advertised.
[...]- error code
- error message
- line number
- character position
- hint from the engine
- timestamp from within the engine
- ...
All of this can be put into the string by the routine raising the
exception:
Sure. That's why there are more JavaScript programmers than Ada programmers.
raise Database_Error with "Error " & Error_Code_Type'image (Error_Code) & ": " & Time_Type'image (Timestamp) & ": " & file_name & ":" & Integer'image (Line_Number) &
":" & Integer'image (Character_Position) & ": " & Message & ": " & Hint;
Of course, with similar routine for dismantling all this in the handler.
Still, that's not what I expect from Ada.
As a general matter of user-interface design, I would find that
annoying. As a user of a system, the only thing I want from an error
message is either "how do I fix this myself" or "how do I report this
to the maintenance team".
That is a reasonable approach and will work fine most of the time, but it does not explain the lack of a language feature that is taken for granted in other languages - and coming from another language, I find the lack of structured exception information as a defect, even though I realize that I can easily work around it.
The point is that I should not be forced to work around anything.
--
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
- References:
- Structured exception information
- From: Maciej Sobczak
- Re: Structured exception information
- From: Stephen Leake
- Re: Structured exception information
- From: Maciej Sobczak
- Re: Structured exception information
- From: Stephen Leake
- Structured exception information
- Prev by Date: Re: Translating an embedded C algorithm
- Next by Date: Re: Jobs available
- Previous by thread: Re: Structured exception information
- Next by thread: Re: Structured exception information
- Index(es):
Relevant Pages
|