diff options
author | Clombrong <cromblong@egregore.fun> | 2025-06-24 12:39:28 +0200 |
---|---|---|
committer | Clombrong <cromblong@egregore.fun> | 2025-06-24 12:39:28 +0200 |
commit | 6dcc7528265b7a2383598314c6ecd38270668f9c (patch) | |
tree | 68ebe657ec9b6ebc3eefcfc42ae9454e46afb810 | |
parent | 76b28e22329a403d675821d46f21af530ca7583c (diff) |
fix(websockets_hello): "handle" exceptions via print_endline
-rw-r--r-- | test/js/websockets_hello.ml | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/test/js/websockets_hello.ml b/test/js/websockets_hello.ml index e5f75f6..91c2b70 100644 --- a/test/js/websockets_hello.ml +++ b/test/js/websockets_hello.ml @@ -37,4 +37,12 @@ let () = let* stream, push = Stream.start domain in Lwt.catch (fun () -> main (stream, push) config >|= (fun () -> push None)) - (fun exn -> push None; Lwt.fail exn) + (fun exn -> + push None; + (* I suspect JavaScript's [wrap_callback] swallows the Exceptions thrown by + OCaml, so... The next best thing is probably printing something. *) + print_endline + (match exn with + | Stream.InvalidStanza stanza -> "Invalid stanza: " ^ stanza + | _ -> "... and so I stumble back to bed."); + Lwt.fail exn) |