comp.lang.ada
 help / color / mirror / Atom feed
From: shaunpatterson@gmail.com
Subject: Common exception handling
Date: Tue, 26 Aug 2008 05:17:32 -0700 (PDT)
Date: 2008-08-26T05:17:32-07:00	[thread overview]
Message-ID: <88961e92-80a8-4e96-b231-9d67eca0adf5@v26g2000prm.googlegroups.com> (raw)

I'm wondering if there is a clean way to do something common for all
throw exceptions and then handle each exception.  For exception...

procedure Test (Rec : Record) is
begin

    ... throw 3 possible exceptions...


exception
    when A =>
       Print_Test (Rec);
       ...
    when B =>
       Print_Test (Rec);
       ...
    when C =>
       Print_Test (Rec);
       ...
    when others =>
       Print_Test (Rec);
end Test;

I'd like to not duplicate the Print_Test in each situation.  Is there
an easy way

Thanks,

Shaun



             reply	other threads:[~2008-08-26 12:17 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-26 12:17 shaunpatterson [this message]
2008-08-26 12:37 ` Common exception handling Ludovic Brenta
2008-08-26 12:39 ` Martin
2008-08-26 12:48   ` Ludovic Brenta
2008-08-26 12:58     ` Martin
2008-08-26 13:47       ` shaunpatterson
2008-08-26 14:43         ` Adam Beneschan
2008-08-26 15:10           ` Dmitry A. Kazakov
2008-08-26 16:49             ` Adam Beneschan
2008-08-26 19:14               ` Dmitry A. Kazakov
2008-08-26 20:22                 ` Maciej Sobczak
2008-08-27  8:16                   ` Dmitry A. Kazakov
2008-08-27  9:20                   ` Georg Bauhaus
2008-08-29  8:32           ` Martin
2008-08-29 15:31             ` Adam Beneschan
2008-09-10 22:51               ` Martin
2008-09-11 14:57                 ` Adam Beneschan
2008-08-26 15:18         ` Jean-Pierre Rosen
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox