# Do-catch behavior in Xcode

**URL:** <https://forums.swift.org/t/do-catch-behavior-in-xcode/58912>\
**Category:** Discussion\
**Tags:** do-catch\
**Created:** [July 13, 2022, 10:01am UTC](https://forums.swift.org/t/do-catch-behavior-in-xcode/58912 "2022-07-13T10:01:48Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Jeehut](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/jeehut/32/21743_2.png) [@Jeehut](https://forums.swift.org/u/Jeehut)\
**Post date:** [July 30, 2022, 9:11pm UTC](https://forums.swift.org/t/do-catch-behavior-in-xcode/58912/3 "2022-07-30T21:11:40Z")

</div>

Like @GreatApe already said, your code shouldn't compile because you're not handling the "catch-all" case with just a simple `catch`. This is a requirement as of Swift 5.7 because the compiler can't possibly know what errors your `methodThatThrowUnknownError()` can potentially throw because Swift simply has no [Precise Error Typing](https://forums.swift.org/t/precise-error-typing-in-swift/52045).

---

_[View the full topic](https://forums.swift.org/t/do-catch-behavior-in-xcode/58912)._
