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!news3.google.com!newsfeed2.dallas1.level3.net!news.level3.com!newsfeed-00.mathworks.com!kanaga.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: Tue, 16 Jan 2007 15:33:53 +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 1168958033 8357 137.138.37.241 (16 Jan 2007 14:33:53 GMT) X-Complaints-To: news@@cern.ch NNTP-Posting-Date: Tue, 16 Jan 2007 14:33:53 +0000 (UTC) User-Agent: Thunderbird 1.5.0.9 (X11/20061220) In-Reply-To: Xref: g2news2.google.com comp.lang.ada:8171 Date: 2007-01-16T15:33:53+01:00 List-Id: 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/