let try_to_string exn = let buf = Buffer.create 128 in let () = bprintf buf "%a" try_print exn in Buffer.contents buf