close the driver on crash

This commit is contained in:
Mylloon 2024-01-26 15:49:25 +01:00
parent c091d0cdd0
commit 025d42b44a
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

View file

@ -6,7 +6,12 @@ open Twitter
let start driver =
let name_driver = prepare driver in
let data_driver = run_process name_driver [] in
let session_id = get_session () in
let session_id =
try get_session () with
| Any msg ->
stop_process data_driver;
raise (Any ("Can't get the session ID: " ^ msg))
in
data_driver, session_id
;;