let catch_exn func = try func () with | e -> fail e