diff options
author | Alain Frisch <alain@frisch.fr> | 2013-09-17 09:30:41 +0000 |
---|---|---|
committer | Alain Frisch <alain@frisch.fr> | 2013-09-17 09:30:41 +0000 |
commit | 2691cf50429e19d0edb8adbd73e16b4295791a0e (patch) | |
tree | 4649c2c01c802298de7309ddcd421c160acf83ae /driver/errors.ml | |
parent | d9a035fa65dcbf4ab11207556dedb5785c16659b (diff) | |
parent | b92a3ca792b754b10d6c0b307d4167bcb7ed632f (diff) |
Integrate exception_registration banch.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14152 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'driver/errors.ml')
-rw-r--r-- | driver/errors.ml | 71 |
1 files changed, 3 insertions, 68 deletions
diff --git a/driver/errors.ml b/driver/errors.ml index 14a1a23cb..bda1a30ac 100644 --- a/driver/errors.ml +++ b/driver/errors.ml @@ -10,72 +10,7 @@ (* *) (***********************************************************************) -(* WARNING: if you change something in this file, you must look at - opterrors.ml and ocamldoc/odoc_analyse.ml - to see if you need to make the same changes there. -*) +(* This module should be removed. We keep it for now, to avoid + breaking external tools depending on it. *) -open Format - -(* Report an error *) - -let report_error ppf exn = - let report ppf = function - | Lexer.Error(err, loc) -> - Location.print_error ppf loc; - Lexer.report_error ppf err - | Syntaxerr.Error err -> - Syntaxerr.report_error ppf err - | Pparse.Error err -> - Pparse.report_error ppf err - | Env.Error err -> - Location.print_error_cur_file ppf; - Env.report_error ppf err - | Cmi_format.Error err -> - Location.print_error_cur_file ppf; - Cmi_format.report_error ppf err - | Ctype.Tags(l, l') -> - Location.print_error_cur_file ppf; - fprintf ppf - "In this program,@ variant constructors@ `%s and `%s@ \ - have the same hash value.@ Change one of them." 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) -> - Location.print_error ppf loc; Typedecl.report_error ppf err - | Typeclass.Error(loc, env, err) -> - Location.print_error ppf loc; Typeclass.report_error env ppf err - | Includemod.Error err -> - Location.print_error_cur_file ppf; - Includemod.report_error ppf err - | Typemod.Error(loc, env, err) -> - Location.print_error ppf loc; Typemod.report_error env ppf err - | Translcore.Error(loc, err) -> - Location.print_error ppf loc; Translcore.report_error ppf err - | Translclass.Error(loc, err) -> - Location.print_error ppf loc; Translclass.report_error ppf err - | Translmod.Error(loc, err) -> - Location.print_error ppf loc; Translmod.report_error ppf err - | Symtable.Error code -> - Location.print_error_cur_file ppf; - Symtable.report_error ppf code - | Bytelink.Error code -> - Location.print_error_cur_file ppf; - Bytelink.report_error ppf code - | Bytelibrarian.Error code -> - Location.print_error_cur_file ppf; - Bytelibrarian.report_error ppf code - | Bytepackager.Error code -> - Location.print_error_cur_file ppf; - Bytepackager.report_error ppf code - | Sys_error msg -> - Location.print_error_cur_file ppf; - fprintf ppf "I/O error: %s" msg - | Warnings.Errors (n) -> - Location.print_error_cur_file ppf; - fprintf ppf "Some fatal warnings were triggered (%d occurrences)" n - | x -> fprintf ppf "@]"; raise x in - - fprintf ppf "@[%a@]@." report exn +let report_error = Location.report_exception |