Skip to content

Commit 6d2b160

Browse files
authored
Merge pull request #582 from Tragicus/prcatch
add catches
2 parents 638499f + 0691f1f commit 6d2b160

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/coq_elpi_vernacular.ml

+5-1
Original file line numberDiff line numberDiff line change
@@ -612,6 +612,9 @@ module Interp = struct
612612
end with e ->
613613
let e = Exninfo.capture e in
614614
Vernacstate.Synterp.unfreeze final_synterp_state;
615+
(match fst e with
616+
| CErrors.UserError _ -> ()
617+
| _ -> Feedback.msg_debug Pp.(str "elpi lets escape exception: " ++ CErrors.print (fst e)));
615618
Exninfo.iraise e)
616619

617620
let run_in_program ?program ~syndata query =
@@ -649,7 +652,8 @@ let run_tactic_common loc ?(static_check=false) program ~main ?(atts=[]) () =
649652
| API.Execute.Success solution -> Coq_elpi_HOAS.tclSOLUTION2EVD sigma solution
650653
| API.Execute.NoMoreSteps -> CErrors.user_err Pp.(str "elpi run out of steps")
651654
| API.Execute.Failure -> elpi_fails program
652-
| exception (Coq_elpi_utils.LtacFail (level, msg)) -> tclFAILn level msg)
655+
| exception (Coq_elpi_utils.LtacFail (level, msg)) -> tclFAILn level msg
656+
| exception e -> let e = Exninfo.capture e in (Feedback.msg_debug Pp.(str "elpi lets escape exception: " ++ CErrors.print (fst e)); Exninfo.iraise e))
653657
tclIDTAC
654658

655659
let run_tactic loc program ~atts _ist args =

0 commit comments

Comments
 (0)