Commit e927dd12 authored by Bruno Guillaume's avatar Bruno Guillaume

improve error message handling

parent a359c71d
......@@ -117,7 +117,7 @@ module Grew_args = struct
| "-debug_loop" :: args -> Rewrite.set_debug_loop (); loop args
| "-dep_dir" :: dir :: args -> dep_dir := Some dir; loop args
| x -> Log.fwarning "Ignored arguments: %s" (String.concat " " x)
| x :: args -> Log.fwarning "Invalid argument: %s, it is ignored!" x; loop args
let parse () =
match Array.to_list Sys.argv with
......
......@@ -19,9 +19,7 @@ open Grew_args
(* -------------------------------------------------------------------------------- *)
let fail msg =
let rule = String.make (String.length msg) '=' in
Log.fwarning "\n%s\n%s\n%s" rule msg rule; exit 2
let fail msg = Log.fmessage "%s" msg; exit 2
let handle fct () =
try fct ()
......
......@@ -31,8 +31,7 @@ let _ =
| Grew_args.Gui args ->
let gui_exec = if Sys.argv.(0) = "grew_dev" then "grew_gui_dev" else "grew_gui" in
match Unix.system (gui_exec ^ " " ^ args) with
| Unix.WEXITED i when i <> 0 ->
Log.warning "It seems that grew_gui is not installed on your system. Try to run \"opam install grew_gui\""
| Unix.WEXITED 127 -> Log.message "It seems that grew_gui is not installed on your system. See [http://grew.fr/gtk] for more information"
| _ -> ()
......
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