diff options
author | Alain Frisch <alain@frisch.fr> | 2013-09-11 16:08:00 +0000 |
---|---|---|
committer | Alain Frisch <alain@frisch.fr> | 2013-09-11 16:08:00 +0000 |
commit | 47be69c2b065d1cb11a73146289ab0ca56792a9e (patch) | |
tree | 06411d2fe416b2aca4ede846813397a0c535b9ed /ocamldoc | |
parent | 2493d3414baeaabbbc871c83608222453a5037ed (diff) |
Cherry-picking commit 14093 from trunk.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/exception_registration@14104 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'ocamldoc')
-rw-r--r-- | ocamldoc/odoc_analyse.ml | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/ocamldoc/odoc_analyse.ml b/ocamldoc/odoc_analyse.ml index 19621cb5e..846724c06 100644 --- a/ocamldoc/odoc_analyse.ml +++ b/ocamldoc/odoc_analyse.ml @@ -124,8 +124,6 @@ let process_error exn = fprintf ppf "In this program,@ variant constructors@ `%s and `%s@ \ have the same hash value." l l' - | Typecore.Error(loc, env, err) -> - Location.print_error ppf loc; Typecore.report_error env ppf err | Typetexp.Error(loc, env, err) -> Location.print_error ppf loc; Typetexp.report_error env ppf err | Typedecl.Error(loc, err) -> @@ -148,10 +146,13 @@ let process_error exn = Location.print_error_cur_file ppf; fprintf ppf "Some fatal warnings were triggered (%d occurrences)" n | x -> - fprintf ppf "@]"; - fprintf ppf - "Compilation error(%s). Use the OCaml compiler to get more details." - (Printexc.to_string x) + match Location.error_of_exn x with + | Some err -> Location.report_error ppf err + | None -> + fprintf ppf "@]"; + fprintf ppf + "Compilation error(%s). Use the OCaml compiler to get more details." + (Printexc.to_string x) in Format.fprintf Format.err_formatter "@[%a@]@." report exn |