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