From 5dc36fd9d386d2546dd312a624190274917499e1 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Sat, 9 Mar 2024 14:49:13 +0100 Subject: [PATCH] better error message --- lib/net.ml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/net.ml b/lib/net.ml index 980dbfb..007f65f 100644 --- a/lib/net.ml +++ b/lib/net.ml @@ -38,6 +38,8 @@ let get_session ?(headless = true) () = let value = List.assoc "value" fields in let rec find_session_id = function | ("sessionId", `String session_id) :: _ -> session_id + | ("error", `String err) :: ("message", `String msg) :: _ -> + raise (Any (Printf.sprintf "%s - %s" err msg)) | _ :: rest -> find_session_id rest | [] -> raise (Any "Session ID not found") in