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

Plugins : more informative and robust

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