diff options
author | Alain Frisch <alain@frisch.fr> | 2013-09-12 15:50:47 +0000 |
---|---|---|
committer | Alain Frisch <alain@frisch.fr> | 2013-09-12 15:50:47 +0000 |
commit | b92a3ca792b754b10d6c0b307d4167bcb7ed632f (patch) | |
tree | 0a34fa5a09ec0cda0a3cd108577c7158838cb7ae /driver | |
parent | 884ca00fdfc1fe5f6165fbb847c6744a47fb59d2 (diff) | |
download | ocaml-exception_registration.tar.gz |
Continue.exception_registration
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/exception_registration@14122 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'driver')
-rw-r--r-- | driver/errors.ml | 3 | ||||
-rw-r--r-- | driver/opterrors.ml | 33 | ||||
-rw-r--r-- | driver/optmain.ml | 4 |
3 files changed, 8 insertions, 32 deletions
diff --git a/driver/errors.ml b/driver/errors.ml index cb1a047ec6..bda1a30ac8 100644 --- a/driver/errors.ml +++ b/driver/errors.ml @@ -10,4 +10,7 @@ (* *) (***********************************************************************) +(* This module should be removed. We keep it for now, to avoid + breaking external tools depending on it. *) + let report_error = Location.report_exception diff --git a/driver/opterrors.ml b/driver/opterrors.ml index 68279bff6e..bda1a30ac8 100644 --- a/driver/opterrors.ml +++ b/driver/opterrors.ml @@ -10,34 +10,7 @@ (* *) (***********************************************************************) -(* WARNING: if you change something in this file, you must look at - errors.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 - | Compilenv.Error code -> - Location.print_error_cur_file ppf; - Compilenv.report_error ppf code - | Asmgen.Error code -> - Location.print_error_cur_file ppf; - Asmgen.report_error ppf code - | Asmlink.Error code -> - Location.print_error_cur_file ppf; - Asmlink.report_error ppf code - | Asmlibrarian.Error code -> - Location.print_error_cur_file ppf; - Asmlibrarian.report_error ppf code - | Asmpackager.Error code -> - Location.print_error_cur_file ppf; - Asmpackager.report_error ppf code - | x -> - match Location.error_of_exn x with - | Some err -> Location.report_error ppf err - | None -> fprintf ppf "@]"; raise x - in - fprintf ppf "@[%a@]@." report exn +let report_error = Location.report_exception diff --git a/driver/optmain.ml b/driver/optmain.ml index 45bdec2446..9f973f2b12 100644 --- a/driver/optmain.ml +++ b/driver/optmain.ml @@ -201,7 +201,7 @@ let main () = end; exit 0 with x -> - Opterrors.report_error ppf x; - exit 2 + Location.report_exception ppf x; + exit 2 let _ = main () |