Is there a way to catch all exceptions?

@Arne_Gebert
To add to @cocreature 's reply, the value of x in your test will be “abc”, not “caught”. Try the following

f : () -> Script Text
f () = do
  try do
    x <- fail "abc"
    pure "unreachable"
  catch
    (ex : AnyException) -> pure $ message ex

test : Script ()
test = do
  x <- f () 
  x === "abc"
  pure ()
1 Like