diff options
author | Clombrong <cromblong@egregore.fun> | 2025-06-11 17:16:56 +0200 |
---|---|---|
committer | Clombrong <cromblong@egregore.fun> | 2025-06-11 17:16:56 +0200 |
commit | 83b07678994d774ebc22cf387229ed7620d7708e (patch) | |
tree | 8b5371c47c1eb9c47ed1f23c42dc51a1053c70a7 /lib/auth.ml | |
parent | ddf8091355e2093343fa73675358548389da93a3 (diff) |
feat(stream): add ClosedStream exception
Diffstat (limited to 'lib/auth.ml')
-rw-r--r-- | lib/auth.ml | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/auth.ml b/lib/auth.ml index c1486d6..606beb6 100644 --- a/lib/auth.ml +++ b/lib/auth.ml @@ -43,5 +43,7 @@ let send_auth_stanza (stream, push) jid pass mechanism = in Markup.(stanza_list |> of_list |> write_xml |> to_string) |> Option.some |> push; let* response = Lwt_stream.get stream in try - Option.get response |> parse_sasl_response |> Lwt.return + match response with + | Some stanza -> parse_sasl_response stanza |> Lwt.return + | None -> Lwt.fail Stream.ClosedStream with exn -> Lwt.fail exn |