let catch_all f a =
try Some (f a) with | _ -> None
let catch exns f a =
try Some (f a) with x ->
if List.mem x exns then None else raise x
let catch_not exns f a =
try Some (f a) with x ->
if List.mem x exns then raise x else None
let tr_exn exns f a =
try f a with x ->
let trx =
try List.assoc x exns
with Not_found -> raise x
in raise trx