Re: Structured exception information



Stephen Leake wrote:

Generally, all you can do is report the error to
the user.
That's what I want to do.

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/
.



Relevant Pages

  • Re: Problems with the SetWindowPos API ...
    ... or do I have free runtimes for my $1.50 that I can distribute and install with my app? ... Also, how about C's messed up order of operations, where several programmers can agree on what a statement clearly says, but the compiler sees something ELSE? ... I tried running a program that contained an embedded interpreter that had an On...GoSub statement to operate the interpreter. ... The error message informed me that they don't do any of the On... ...
    (microsoft.public.vb.enterprise)
  • Re: Word count of minimum vocabulary
    ... In learning a foreign ... language, it frequently is the case that one doesn't want to master ... Answer: From Collins Concise Dictionay: ideogram or ideograph: a sign ... Hint: if they did represent concepts, ...
    (sci.lang)
  • Re: more hackintoshery...
    ... Simon Dobbs wrote: ... error message along the lines of: ... regular chastisement for unix programmers. ...
    (uk.comp.sys.mac)
  • Re: more hackintoshery...
    ... error message along the lines of: ... After failing to find "grok" in his German/English dictionary, ... regular chastisement for unix programmers. ...
    (uk.comp.sys.mac)
  • Re: more hackintoshery...
    ... error message along the lines of: ... After failing to find "grok" in his German/English dictionary, ... regular chastisement for unix programmers. ...
    (uk.comp.sys.mac)