From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,699cc914522aa7c4 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news2.google.com!news4.google.com!news.glorb.com!news.cs.univ-paris8.fr!univ-lyon1.fr!news.in2p3.fr!in2p3.fr!kanaga.switch.ch!ezmp3.switch.ch!news-zh.switch.ch!switch.ch!cernne03.cern.ch!not-for-mail From: Maciej Sobczak Newsgroups: comp.lang.ada Subject: Re: Structured exception information Date: Wed, 17 Jan 2007 15:05:10 +0100 Organization: CERN News Message-ID: References: NNTP-Posting-Host: abpc10883.cern.ch Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: cernne03.cern.ch 1169042711 11409 137.138.37.241 (17 Jan 2007 14:05:11 GMT) X-Complaints-To: news@@cern.ch NNTP-Posting-Date: Wed, 17 Jan 2007 14:05:11 +0000 (UTC) User-Agent: Thunderbird 1.5.0.9 (X11/20061220) In-Reply-To: Xref: g2news2.google.com comp.lang.ada:8224 Date: 2007-01-17T15:05:10+01:00 List-Id: 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/