diff options
| author | Emilio Jesus Gallego Arias | 2019-03-03 16:49:30 +0100 |
|---|---|---|
| committer | Emilio Jesus Gallego Arias | 2019-07-07 00:57:28 +0200 |
| commit | 07abf9818a6b47bb2c2bd0a8201da9743a0c10b6 (patch) | |
| tree | 0325550fcf395bad3f4951259202f97db182fbaf /user-contrib | |
| parent | ae7fc8bc74289bd8a1eca48c8ca8ecf923888285 (diff) | |
[error] Remove special error printing pre-processing
We remove the special error printing pre-processing in favor of just
calling the standard printers.
Error printing has been a bit complex for a while due to an incomplete
migration to a new printing scheme based on registering exception
printers; this PR should alleviate that by completing the registration
approach.
After this cleanup, it should not be ever necessary for normal
functions to worry a lot about catching errors and re-raising them,
unless they have some very special needs.
This change also allows to consolidate the `explainErr` and `himsg`
modules into one, removing the need to export the error printing
functions. Ideally we would make the contents of `himsg` more
localized, but this can be done in a gradual way.
Diffstat (limited to 'user-contrib')
| -rw-r--r-- | user-contrib/Ltac2/tac2entries.ml | 6 | ||||
| -rw-r--r-- | user-contrib/Ltac2/tac2print.ml | 3 |
2 files changed, 4 insertions, 5 deletions
diff --git a/user-contrib/Ltac2/tac2entries.ml b/user-contrib/Ltac2/tac2entries.ml index 624d4d7f04..3b8fc58c6f 100644 --- a/user-contrib/Ltac2/tac2entries.ml +++ b/user-contrib/Ltac2/tac2entries.ml @@ -811,18 +811,18 @@ let () = register_handler begin function | _ -> raise Unhandled end -let () = ExplainErr.register_additional_error_info begin fun (e, info) -> +let () = CErrors.register_additional_error_info begin fun info -> if !Tac2interp.print_ltac2_backtrace then let bt = Exninfo.get info backtrace in let bt = match bt with | Some bt -> bt - | None -> raise Exit + | None -> [] in let bt = str "Backtrace:" ++ fnl () ++ prlist_with_sep fnl pr_frame bt ++ fnl () in Some (Loc.tag @@ Some bt) - else raise Exit + else None end (** Printing *) diff --git a/user-contrib/Ltac2/tac2print.ml b/user-contrib/Ltac2/tac2print.ml index b89067086f..1ece3d4242 100644 --- a/user-contrib/Ltac2/tac2print.ml +++ b/user-contrib/Ltac2/tac2print.ml @@ -473,8 +473,7 @@ end let () = register_init "err" begin fun _ _ e -> let e = to_ext val_exn e in - let (e, _) = ExplainErr.process_vernac_interp_error e in - str "err:(" ++ CErrors.print_no_report e ++ str ")" + str "err:(" ++ CErrors.iprint e ++ str ")" end let () = |
