# \[Pitch\] \`guard do ... catch\`: local error handling with early-exit and bound variables

**URL:** <https://forums.swift.org/t/pitch-guard-do-catch-local-error-handling-with-early-exit-and-bound-variables/90330>\
**Category:** Pitches\
**Tags:** guard, error-handling\
**Created:** [October 29, 2026, 2:30pm UTC](https://forums.swift.org/t/pitch-guard-do-catch-local-error-handling-with-early-exit-and-bound-variables/90330 "2026-10-29T14:30:00Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![CodebyCR](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/codebycr/32/34814_2.png) [@CodebyCR](https://forums.swift.org/u/CodebyCR)\
**Post date:** [October 30, 2026, 6:46am UTC](https://forums.swift.org/t/pitch-guard-do-catch-local-error-handling-with-early-exit-and-bound-variables/90330/6 "2026-10-30T06:46:54Z")

</div>

I believe there have been a few similar suggestions, which unfortunately didn’t work out, but I’m familiar with this sticking point.

I think the real problem is that, in the `else` branch of the `guard` statement, you don’t have access to the thrown error.

I think the cleanest solution is a `guard-catch` statement.

> [@Guard/Catch](https://forums.swift.org/t/guard-catch/6264):
>
> I’d like to propose a guard/catch construct to the language. It would allow code to use throwing functions and handle errors fully, without straying from a happy path. do/catch can be a bit heavy-handed sometimes, and it would be nice to be able to handle throwing functions without committing to all the nesting and ceremony of do/catch. Full proposal, which discusses all the corner cases and alternatives: Looking forward to feedback! Soroush

---

_[View the full topic](https://forums.swift.org/t/pitch-guard-do-catch-local-error-handling-with-early-exit-and-bound-variables/90330)._
