From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id WAA17112; Sat, 13 Jul 2002 22:28:23 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id WAA17082 for caml-list@pauillac.inria.fr; Sat, 13 Jul 2002 22:28:22 +0200 (MET DST) Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id PAA10599 for ; Sat, 13 Jul 2002 15:30:27 +0200 (MET DST) X-SPAM-Warning: Sending machine is listed in blackholes.five-ten-sg.com Received: from dsf (adsl-63-196-84-93.dsl.sndg02.pacbell.net [63.196.84.93]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g6DDUPf28003 for ; Sat, 13 Jul 2002 15:30:26 +0200 (MET DST) Received: from dsf by dsf with local (Exim 3.33 #1 (Debian)) id 17TMye-0003JJ-00; Sat, 13 Jul 2002 06:30:24 -0700 To: caml-list@inria.fr Subject: Re: [Caml-list] Exceptions and at_exit References: <874rgjdjku.fsf@foxthompson.net> From: David Fox Date: 13 Jul 2002 06:30:23 -0700 In-Reply-To: <874rgjdjku.fsf@foxthompson.net> Message-ID: <87ele721sg.fsf@foxthompson.net> User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk David Fox writes: > I have some at_exit functions that must execute before my program > exits, but I also want to see a traceback of any exception that > occurs. Can I catch the exception, print a traceback like the one you > get when you exit and then call exit? Or can I catch the exception, > execute the at_exit functions, and then re-raise the exception? How > *do* you re-raise an exception, anyway? Do you just catch the > exception and raise it? My confusion about re-raising exceptions was caused by the fact that you get different behavior if you say something like try ... with Failure msg -> ; raise (Failure msg) vs something like try ... with exn -> begin match exn with Failure msg -> end; raise exn In the second case, you are re-raising the exception, in the first you are raising a new exception and your original traceback is lost. ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners