# Is there a way to catch all exceptions?

**URL:** <https://forum.canton.network/t/is-there-a-way-to-catch-all-exceptions/3609>\
**Category:** App Development\
**Tags:** daml\
**Created:** [December 20, 2021, 7:40pm UTC](https://forum.canton.network/t/is-there-a-way-to-catch-all-exceptions/3609 "2021-12-20T19:40:02Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![a\_putkov](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/a_putkov/32/2971_2.png) [@a\_putkov](https://forum.canton.network/u/a_putkov)\
**Post date:** [October 18, 2022, 5:01pm UTC](https://forum.canton.network/t/is-there-a-way-to-catch-all-exceptions/3609/6 "2022-10-18T17:01:23Z")

</div>

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

```haskell
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 ()

```

---

_[View the full topic](https://forum.canton.network/t/is-there-a-way-to-catch-all-exceptions/3609)._
