From a8648828c3546e3ad7cf474ba4a87c2faa245b9f Mon Sep 17 00:00:00 2001 From: Claudio Sacerdoti Coen Date: Fri, 3 Jun 2011 08:32:32 +0000 Subject: [PATCH] Avoid killing the main gui thread. --- matita/matita/matitaExcPp.ml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/matita/matita/matitaExcPp.ml b/matita/matita/matitaExcPp.ml index 5b9cb4347..da46ed88c 100644 --- a/matita/matita/matitaExcPp.ml +++ b/matita/matita/matitaExcPp.ml @@ -112,8 +112,9 @@ let compact_disambiguation_errors all_passes errorll = choices ;; -let rec to_string = - function +let rec to_string exn = + try + (match exn with HExtlib.Localized (floc,exn) -> let _,msg = to_string exn in let (x, y) = HExtlib.loc_of_floc floc in @@ -139,6 +140,8 @@ let rec to_string = None, "NRefiner uncertain: " ^ snd (Lazy.force msg) | NCicMetaSubst.Uncertain msg -> None, "NCicMetaSubst uncertain: " ^ Lazy.force msg + | NCicMetaSubst.MetaSubstFailure msg -> + None, "NCicMetaSubst failure: " ^ Lazy.force msg | NCicTypeChecker.TypeCheckerFailure msg -> None, "NTypeChecker failure: " ^ Lazy.force msg | NCicTypeChecker.AssertFailure msg -> @@ -236,5 +239,6 @@ let rec to_string = loc, "********** DISAMBIGUATION ERRORS: **********\n" ^ explain (aux errorll) - | exn -> None, ("Uncaught exception: " ^ Printexc.to_string exn ^ Printexc.get_backtrace ()) - + | exn -> None, ("Uncaught exception: " ^ Printexc.to_string exn ^ Printexc.get_backtrace ())) + with exn -> + None, ("Exception raised during pretty-printing of an exception: " ^ Printexc.to_string exn ^ Printexc.get_backtrace ()) -- 2.39.2