From 954239ed796367027c49a8b0808e596c1b68d2d7 Mon Sep 17 00:00:00 2001 From: Clombrong Date: Sun, 29 Jun 2025 15:31:26 +0200 Subject: style(sasl): rename sasl_error to error --- lib/sasl.ml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/sasl.ml b/lib/sasl.ml index 4498fec..3cd1220 100644 --- a/lib/sasl.ml +++ b/lib/sasl.ml @@ -10,7 +10,7 @@ type config = { preferred_mechanisms : mechanism list; } -type sasl_error = +type error = | NotAuthorized | MalformedRequest @@ -22,12 +22,12 @@ let parse_mechanism = function | "PLAIN" -> PLAIN | other -> Unknown other -let parse_sasl_error = function +let parse_error = function | "not-authorized" -> NotAuthorized | "malformed-request" -> MalformedRequest | _ -> failwith "Unsupported SASL error returned by the server." -type sasl_auth = (string option, sasl_error * (string * string) option) result +type sasl_auth = (string option, error * (string * string) option) result let send_auth_stanza ({stream; push; _} : Portal.t) localpart pass mechanism = let gen_auth = function @@ -50,7 +50,7 @@ let send_auth_stanza ({stream; push; _} : Portal.t) localpart pass mechanism = | ("success", []) -> Ok None | ("success", [Right rest]) -> Ok (Some rest) | ("failure", [Left {local_name=error; children; _}]) -> - Error (parse_sasl_error error, parse_descriptive_text children) + Error (parse_error error, parse_descriptive_text children) | _ -> raise (Xml.InvalidStanza (Xml.element_to_string stanza)) in let stanza_list = [`Start_element ((Xmlns.sasl, "auth"), -- cgit v1.2.3