register missing compiler error printer

This commit is contained in:
Jeremie Dimino 2016-02-24 11:03:51 +00:00
parent a51d79079a
commit c816baf8fb
1 changed files with 9 additions and 2 deletions

View File

@ -1424,10 +1424,17 @@ let interact ~search_path ~unit ~loc:(fname, lnum, cnum, _) ~values =
| exception (Found env) ->
try
Clflags.include_dirs := cmt_infos.cmt_loadpath @ !Clflags.include_dirs;
let env = Env.env_of_only_summary Envaux.env_from_summary env in
let env = Envaux.env_of_only_summary env in
List.iter (fun (V (name, v)) -> Toploop.setvalue name (Obj.repr v)) values;
main_internal ~initial_env:(Some env)
with exn ->
Location.report_exception Format.err_formatter exn;
exit 2
;;
let () =
Location.register_error_of_exn
(function
| Envaux.Error err ->
Some (Location.error_of_printer_file Envaux.report_error err)
| _ -> None
)