From 8320bbd567910566a44f407f43f510a8131bd53b Mon Sep 17 00:00:00 2001 From: Ryan Kavanagh Date: Sun, 7 Jun 2020 21:58:39 -0400 Subject: Handle tls failures as well --- gemini/geminiTransaction.ml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gemini/geminiTransaction.ml b/gemini/geminiTransaction.ml index 77f1206..56cbb7f 100644 --- a/gemini/geminiTransaction.ml +++ b/gemini/geminiTransaction.ml @@ -241,8 +241,11 @@ struct let%lwt () = Lwt_io.write oc (Uri.to_string r.url ^ "\r\n") in let%lwt (_, parsed) = parse response_parser ic in Lwt.return parsed - with | Tls_lwt.Tls_alert alert -> + with + | Tls_lwt.Tls_alert alert -> Lwt.return (Error (Tls.Packet.alert_type_to_string alert)) + | Tls_lwt.Tls_failure failure -> + Lwt.return (Error (Tls.Engine.string_of_failure failure)) let rec session req = match%lwt transaction req with -- cgit v1.2.3