# Combining ? with throwing when there's no reasonable default

**URL:** <https://forums.swift.org/t/combining-with-throwing-when-theres-no-reasonable-default/20722>\
**Category:** Discussion\
**Created:** [February 20, 2019, 8:42pm UTC](https://forums.swift.org/t/combining-with-throwing-when-theres-no-reasonable-default/20722 "2019-02-20T20:42:09Z")\
**Posts on this page:** 1\
**Showing post:** 26

<div class="post-metadata">

**Author:** ![Ray\_Fix](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/ray_fix/32/1479_2.png) [@Ray\_Fix](https://forums.swift.org/u/Ray_Fix)\
**Post date:** [September 2, 2020, 11:05pm UTC](https://forums.swift.org/t/combining-with-throwing-when-theres-no-reasonable-default/20722/26 "2020-09-02T23:05:21Z")

</div>

I feel bridging the worlds of nil failing and throwing initializers with as little friction as possible is important. There is a tendency I have noticed in myself to nil coalesce to a bogus value that I'll fix real soon(TM). But if I have the right tool to reach for, I am more likely to do the right thing.

I proposed a slightly different (non-operator) spelling:

> [@Throw on nil](https://forums.swift.org/t/throw-on-nil/39970):
>
> I find myself wanting to define an operation that converts failable initializers to throwing ones. When I have a throwing initializer contains multiple failing initializers, I think it improves the clarity and readability of the code. (see below) UPDATE: Leaving the original implementation but I am not opposed to changing the spelling or making this an operator or whatever. Lots of great ideas and info below. extension Optional { func orThrow(\_ error: @autoclosure () -\> Error) throws -\> W…

---

_[View the full topic](https://forums.swift.org/t/combining-with-throwing-when-theres-no-reasonable-default/20722)._
