Zulip Chat Archive

Stream: metaprogramming / tactics

Topic: Catch all exceptions


Leni Aniva (Feb 20 2026 at 04:32):

Is there a way to catch all exceptions including internal exceptions, when running a CoreM monad?

e.g.

try
    Lean.tryCatchRuntimeEx (
      withReader ({ · with cancelTk? := .some cancelTk }) do
      Core.withCurrHeartbeats metaM.run') λ _e => pure false
catch e =>
  ...

This doesn't catch internal exception #0.

Sebastian Ullrich (Feb 20 2026 at 09:00):

let _ := MonadAlwaysExcept.except (m := CoreM)
try
  ...

Last updated: Feb 28 2026 at 14:05 UTC