diff options
| author | Emilio Jesus Gallego Arias | 2020-06-25 20:08:04 +0200 |
|---|---|---|
| committer | Emilio Jesus Gallego Arias | 2020-07-09 19:39:47 +0200 |
| commit | 20f55b720be8018cdf9690d60e4ed05d9c8ad5c3 (patch) | |
| tree | 98ea37269ad171112a44421d363f354205c49a5b /pretyping/reductionops.ml | |
| parent | 577ec77f17a872d6bc36073ceeb3cf582fcf01c4 (diff) | |
[exn] Remove some uses of print
Exceptions should not printed except for the top-level.
There is the weird anomaly-absorbing code in `Reductionops`, I wonder
how frequent that case is, but as the exception is absorbed printing
there could have a real impact.
Diffstat (limited to 'pretyping/reductionops.ml')
| -rw-r--r-- | pretyping/reductionops.ml | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/pretyping/reductionops.ml b/pretyping/reductionops.ml index 6f02d76f3a..cb6e8f086e 100644 --- a/pretyping/reductionops.ml +++ b/pretyping/reductionops.ml @@ -1097,12 +1097,17 @@ let pb_equal = function | Reduction.CUMUL -> Reduction.CONV | Reduction.CONV -> Reduction.CONV +exception AnomalyInConversion of exn + +let _ = CErrors.register_handler (function + | AnomalyInConversion e -> + Some Pp.(str "Conversion test raised an anomaly:" ++ + spc () ++ CErrors.print e) + | _ -> None) + let report_anomaly (e, info) = let e = - if is_anomaly e then - let msg = Pp.(str "Conversion test raised an anomaly:" ++ - spc () ++ CErrors.print e) in - UserError (None, msg) + if is_anomaly e then AnomalyInConversion e else e in Exninfo.iraise (e, info) |
