# \[Pitch N+1\] Typed Throws

**URL:** <https://forums.swift.org/t/pitch-n-1-typed-throws/67496>\
**Category:** Pitches\
**Created:** [September 25, 2023, 4:25am UTC](https://forums.swift.org/t/pitch-n-1-typed-throws/67496 "2023-09-25T04:25:05Z")\
**Posts on this page:** 1\
**Showing post:** 172

<div class="post-metadata">

**Author:** ![wadetregaskis](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/wadetregaskis/32/8494_2.png) [@wadetregaskis](https://forums.swift.org/u/wadetregaskis)\
**Post date:** [October 2, 2023, 5:47am UTC](https://forums.swift.org/t/pitch-n-1-typed-throws/67496/172 "2023-10-02T05:47:01Z")

</div>

Also, [looking at the Git history](https://github.com/apple/swift-book/commit/5e197edebb905ee77f3079ce537f7f1fefac9970), it appears this behaviour was newly permitted as of Swift 3. In Swift 2 (based on the earlier version of that section of documentation) it was explicitly _not_ permitted to throw a different error. In fact the docs were very clear that you could _only_ pass up errors created elsewhere, you could not in any way create your own. You couldn't even _use_ a do-catch block inside a rethrowing function!

> A rethrowing function or method can't directly throw any errors of its own, which means it can't contain a `throw` statement. It can only propagate errors thrown by the throwing function it takes as a parameter. For example, it is not possible to call the throwing function inside a `do`-`catch` block.

So yeah, originally it appears that `rethrows` truly was a "I just pass through errors untouched" marker.

Typed throws alone cannot technically express that either, as discussed earlier in this thread, although it gets closer.

It appears, from that clearly deliberate change, that there was a need for that capability. It'd be interesting to hear from the author - @Alex_Martini - as to whether they recall the reasoning for the change.

Though in any case, probably a more important gauge of its need would be to survey existing code at scale.

---

_[View the full topic](https://forums.swift.org/t/pitch-n-1-typed-throws/67496)._
