Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
try with
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: tmp123@m...
Subject: try with

Sorry for an easy question about exceptions:

If in a code like:

let v1 = f1 () in
f2 v1

I like to handle in a different way an exception (like Not_found) 
produced inside f1 of the same one produced in f2 (or even not treat the 
one produced in f2), which one is a correct way to write the code?

Because the only thing I see up to now is something so overloaded as:

exception Skip;
  let v1 =
      Not_found -> handle_f1_exception();
                   raise Skip
    f2 v1
  Skip -> ();

Thanks again.