Re: Common exception handling



Maciej Sobczak schrieb:
On 26 Sie, 21:14, "Dmitry A. Kazakov" <mail...@xxxxxxxxxxxxxxxxx>
wrote:

I wished to have ranges of exceptions

Hierarchies, not ranges.

The difference is that entities in the hierarchy can be not only
extended but also specialized and that would nicely fit in the OO part
of the language.

Meanwhile, using a nested programming language,
we can do

type Throwable is tagged private;
...

procedure Outer is
Fail: exception;

package OO_Exception is
type Relevant_Info is new Throwable with
-- everything needed to known what
-- has happened deep down the call chain
record
...
end record;
procedure Prim_Op(Recording: Relevant_Info);

end OO_Exception;

package body OO_Exception is separate;
use OO_Exception;

procedure Inner is
begin
...
end Inner;


Scrap_Book: Relevant_Info;

begin
Inner;
exception
when Fail =>
Prim_Op(Scrap_Book);
end Outer;

--
Georg Bauhaus
Y A Time Drain http://www.9toX.de
.



Relevant Pages

  • Re: Inheriting from ApplicationException - Taboo? Jeffrey Richter says so...
    ... It does have a point, I never catch the ApplicationException, either catch ... the particular exception I'm interested or Exception, ... > "Designing exception hierarchies is tricky. ... > which there is a programmatic scenario for catching. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Exceptions as return values
    ... KC - Designing exception hierarchies is tricky. ... ApplicationException thinking it would add value by grouping exceptions ... catching ApplicationException and it only adds unnecessary depth to the ...
    (microsoft.public.dotnet.languages.csharp)