On Mon, Jan 17, 2011 at 10:37 AM, xclerc wrote: > The underlying problem is that "Printexc.print_backtrace" prints the > backtrace > for the last exception raised... which can be one raised by > "Printf.eprintf" or > "Printexc.to_string", but locally caught and not exposed to the outside > world. > Okay, that makes sense. > You will get different backtraces according to the value of > "custom_printer". > I'm actually getting the same output (just "Not_found" printed). Tried native and byte code, on two different systems. Based on your explanation, I was expecting the following to give different output if you change true to false. But actually nothing is printed out in any case. So I'm really unclear now as to what print_backtrace does. let f () = try raise Not_found with Not_found -> () let g () = raise (Failure "") let () = try g() with e -> ( if true then f() else (); Printexc.print_backtrace stderr )