# iOS Try/Catch

**URL:** <https://forum.xojo.com/t/ios-try-catch/21605>\
**Category:** iOS\
**Created:** [January 15, 2015, 2:23pm UTC](https://forum.xojo.com/t/ios-try-catch/21605 "2015-01-15T14:23:04Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Phillip\_Zedalis](https://forum.xojo.com/user_avatar/forum.xojo.com/phillip_zedalis/32/1151_2.png) [@Phillip\_Zedalis](https://forum.xojo.com/u/Phillip_Zedalis)\
**Post date:** [January 15, 2015, 2:23pm UTC](https://forum.xojo.com/t/ios-try-catch/21605/1 "2015-01-15T14:23:04Z")

</div>

So on Desktop & iOS Simulator the following is perfectly fine:

Try  
DoSomethingBad()  
Catch  
UhOh()  
End Try

However when you go to build it hard crashes the entire IDE. Took me a long time to figure this out. Turns out all you have to do is handle the appropriate exception. In my case:

Try  
DoSomethingBad()  
Catch e As RuntimeException  
UhOh()  
End Try

Just an FYI for anyone who searches in the future.

---

<div class="post-metadata">

**Author:** ![Bob\_Keeney](https://forum.xojo.com/letter_avatar_proxy/v4/letter/b/54ee81/32.png) [@Bob\_Keeney](https://forum.xojo.com/u/Bob_Keeney)\
**Post date:** [January 15, 2015, 3:07pm UTC](https://forum.xojo.com/t/ios-try-catch/21605/2 "2015-01-15T15:07:10Z")

</div>

Good catch, Phillip. Though, I have to wonder if this was intentional or not. Have you submitted a Feedback Case for it?

---

<div class="post-metadata">

**Author:** ![Jim\_Meyer](https://forum.xojo.com/letter_avatar_proxy/v4/letter/j/df788c/32.png) [@Jim\_Meyer](https://forum.xojo.com/u/Jim_Meyer)\
**Post date:** [January 15, 2015, 3:58pm UTC](https://forum.xojo.com/t/ios-try-catch/21605/3 "2015-01-15T15:58:07Z")

</div>

Yes, good catch (no pun intended)… it seems to have fixed my iOS build crash…

---

<div class="post-metadata">

**Author:** ![Joe\_Ranieri](https://forum.xojo.com/letter_avatar_proxy/v4/letter/j/43a26b/32.png) [@Joe\_Ranieri](https://forum.xojo.com/u/Joe_Ranieri)\
**Post date:** [January 15, 2015, 4:24pm UTC](https://forum.xojo.com/t/ios-try-catch/21605/4 "2015-01-15T16:24:13Z")

</div>

> [@159589:@Phillip Zedalis](#):
>
> However when you go to build it hard crashes the entire IDE.

This definitely shouldn’t crash the IDE. Please file a bug report.

---

<div class="post-metadata">

**Author:** ![Phillip\_Zedalis](https://forum.xojo.com/user_avatar/forum.xojo.com/phillip_zedalis/32/1151_2.png) [@Phillip\_Zedalis](https://forum.xojo.com/u/Phillip_Zedalis)\
**Post date:** [January 16, 2015, 8:08am UTC](https://forum.xojo.com/t/ios-try-catch/21605/5 "2015-01-16T08:08:12Z")

</div>

No but I will. I’ve been kind of nocturnal lately and I was trying to push out a build and this kept me from going to bed… this morning. I’ll write it up very soon.

---

<div class="post-metadata">

**Author:** ![system](https://forum.xojo.com/uploads/default/original/1X/455b4dcc0e61630e9f81940004ddffa49c432a46.png) [@system](https://forum.xojo.com/u/system)\
**Post date:** [October 29, 2020, 5:34pm UTC](https://forum.xojo.com/t/ios-try-catch/21605/6 "2020-10-29T17:34:44Z")

</div>


