Commit 0ba7667e authored by François Bobot's avatar François Bobot

Plugins : more informative and robust

parent d22586e2
......@@ -106,8 +106,9 @@ let load_plugins m =
let dirs = [pluginsdir m] in
let load x =
try Plugin.load ~dirs x
with Plugin.Plugin_Not_Found _ as exn
-> Format.eprintf "%a@." Exn_printer.exn_printer exn in
with exn ->
Format.eprintf "%s can't be loaded : %a@." x
Exn_printer.exn_printer exn in
List.iter load m.plugins
type config = {
......
......@@ -189,6 +189,7 @@ let option_list = Arg.align [
"<flag> Set a debug flag" ]
let () =
try
Arg.parse option_list add_opt_file usage_msg;
(** Debug flag *)
......@@ -317,6 +318,9 @@ let () =
add_meta task meta [MAstr s]
in
opt_task := List.fold_left add_meta !opt_task !opt_metas
with e when not (Debug.test_flag Debug.stack_trace) ->
eprintf "%a@." Exn_printer.exn_printer e;
exit 1
let timelimit = match !opt_timelimit with
| None -> 10
......
......@@ -46,4 +46,6 @@ let () =
| Plugin_Not_Found (pl,sl) ->
Format.fprintf fmt "The plugin %s can't be found in the directories %a"
pl (Pp.print_list Pp.space Pp.string) sl
| Dynlink.Error (error) ->
Format.fprintf fmt "Dynlink error : %s@." (Dynlink.error_message error)
| _ -> raise exn)
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