summaryrefslogtreecommitdiffstats
path: root/ocamldoc/odoc_analyse.ml
diff options
context:
space:
mode:
authorAlain Frisch <alain@frisch.fr>2013-09-11 16:05:40 +0000
committerAlain Frisch <alain@frisch.fr>2013-09-11 16:05:40 +0000
commit2493d3414baeaabbbc871c83608222453a5037ed (patch)
tree426c3c26dcbcbe95c156242039c39d3f49cb9e12 /ocamldoc/odoc_analyse.ml
parent4b6c40b8ba54e4a327388debbdd17e016e99688e (diff)
parent637893aa3cb4d2c5a3ab85191d79d6d8941be91c (diff)
Branch for experimenting with a new way to define and use error printers.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/exception_registration@14103 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'ocamldoc/odoc_analyse.ml')
-rw-r--r--ocamldoc/odoc_analyse.ml13
1 files changed, 6 insertions, 7 deletions
diff --git a/ocamldoc/odoc_analyse.ml b/ocamldoc/odoc_analyse.ml
index 846724c06..19621cb5e 100644
--- a/ocamldoc/odoc_analyse.ml
+++ b/ocamldoc/odoc_analyse.ml
@@ -124,6 +124,8 @@ 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) ->
@@ -146,13 +148,10 @@ let process_error exn =
Location.print_error_cur_file ppf;
fprintf ppf "Some fatal warnings were triggered (%d occurrences)" n
| 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)
+ 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