X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=matita%2Fmatita%2FmatitaExcPp.ml;h=b0a5c7f12cbf91acb1e251c76d039cf564cf9309;hb=74223db3fc45caccb3cfac80971b29cb0613da28;hp=5b9cb434740e3cc194150c7717c0dc00d770ad98;hpb=1319bb002c3092e803477f6f7f6f0fa73c2fd6fb;p=helm.git diff --git a/matita/matita/matitaExcPp.ml b/matita/matita/matitaExcPp.ml index 5b9cb4347..b0a5c7f12 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 @@ -123,7 +124,7 @@ let rec to_string = | GrafiteTypes.Command_error msg -> None, "Error: " ^ msg | CicNotationParser.Parse_error err -> None, sprintf "Parse error: %s" err - | Unix.Unix_error (code, api, param) -> + | Unix.Unix_error (code, api, _param) -> let err = Unix.error_message code in None, "Unix Error (" ^ api ^ "): " ^ err | HMarshal.Corrupt_file fname -> None, sprintf "file '%s' is corrupt" fname @@ -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,7 @@ 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: " ^ + snd (to_string exn))