Zulip Chat Archive

Stream: metaprogramming / tactics

Topic: Add context for `throwError`


Leni Aniva (Jan 06 2026 at 22:24):

Is there a way to have context (analogous to Rust's wrap_err) for exceptions thrown by throwError? e.g.

def a : MetaM Unit := do
  fallible

def b : MetaM Unit := do
  fallible

def main : MetaM Unit := do
  a
  b

and I want to discern the source of an error thrown in fallible.

Sebastian Ullrich (Jan 07 2026 at 08:06):

Not built-in but see uses of e.g. throwNestedTacticEx for one such pattern


Last updated: Feb 28 2026 at 14:05 UTC