English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
[Caml-list] Exceptions and at_exit
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2002-07-13 (20:44)
From: William Lovas <wlovas@s...>
Subject: Re: [Caml-list] Exceptions and at_exit
On Sat, Jul 13, 2002 at 06:30:23AM -0700, David Fox wrote:
> 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 -> <do some stuff>; raise (Failure msg)
> vs something like
>   try ... with
>     exn ->
>        begin match exn with Failure msg -> <do some stuff> 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.

What if you did something like:

    try ... with
        Failure msg as exn -> <do some stuff>; raise exn

Would that leave the original traceback intact?

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