diff options
Diffstat (limited to 'lib/errors.ml')
-rw-r--r-- | lib/errors.ml | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/errors.ml b/lib/errors.ml index 3b5e6770..6affea23 100644 --- a/lib/errors.ml +++ b/lib/errors.ml @@ -28,7 +28,7 @@ let rec print_gen bottom stk e = try h e with | Unhandled -> print_gen bottom stk' e - | e' -> print_gen bottom stk' e' + | any -> print_gen bottom stk' any (** Only anomalies should reach the bottom of the handler stack. In usual situation, the [handle_stack] is treated as it if was always @@ -66,3 +66,14 @@ let _ = register_handler begin function | _ -> raise Unhandled end +(** Critical exceptions shouldn't be catched and ignored by mistake + by inner functions during a [vernacinterp]. They should be handled + only at the very end of interp, to be displayed to the user. *) + +(** NB: in the 8.4 branch, for maximal compatibility, anomalies + are considered non-critical *) + +let noncritical = function + | Sys.Break | Out_of_memory | Stack_overflow -> false + | _ -> true + |