Commit c447eb65 authored by Bruno Guillaume's avatar Bruno Guillaume
Browse files

catch Sys_error

parent 6a146c82
...@@ -19,7 +19,11 @@ open Grew_args ...@@ -19,7 +19,11 @@ open Grew_args
(* -------------------------------------------------------------------------------- *) (* -------------------------------------------------------------------------------- *)
let fail msg = Log.fmessage "%s" msg; exit 2 let fail msg =
Log.fmessage "-------------------------------------";
Log.fmessage "%s" msg;
Log.fmessage "-------------------------------------";
exit 2
let handle fct () = let handle fct () =
try fct () try fct ()
...@@ -28,7 +32,7 @@ let handle fct () = ...@@ -28,7 +32,7 @@ let handle fct () =
| Libgrew.Error msg -> fail msg | Libgrew.Error msg -> fail msg
| Corpus.File_not_found file -> fail (sprintf "File not found: \"%s\"" file) | Corpus.File_not_found file -> fail (sprintf "File not found: \"%s\"" file)
| Corpus.Fail msg -> fail msg | Corpus.Fail msg -> fail msg
| Sys_error msg -> fail (sprintf "System error: %s" msg)
| Libgrew.Bug msg -> fail (sprintf "Libgrew.bug, please report: %s" msg) | Libgrew.Bug msg -> fail (sprintf "Libgrew.bug, please report: %s" msg)
| exc -> fail (sprintf "Uncaught exception, please report: %s" (Printexc.to_string exc)) | exc -> fail (sprintf "Uncaught exception, please report: %s" (Printexc.to_string exc))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment