# Throw and catch

**URL:** <https://forum.crystal-lang.org/t/throw-and-catch/256>\
**Category:** Offtopic\
**Created:** [January 5, 2019, 8:03pm UTC](https://forum.crystal-lang.org/t/throw-and-catch/256 "2019-01-05T20:03:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![vladfaust](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/vladfaust/32/48_2.png) [@vladfaust](https://forum.crystal-lang.org/u/vladfaust)\
**Post date:** [January 5, 2019, 8:03pm UTC](https://forum.crystal-lang.org/t/throw-and-catch/256/1 "2019-01-05T20:03:54Z")

</div>

So, most of all familiar with `throw` and `catch` thing in Ruby. It’s sometimes useful to be able to break away from a deep-leveled stack. And raising a error is quite expensive. Why isn’t it in the language yet?

---

<div class="post-metadata">

**Author:** ![RX14](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/rx14/32/633_2.png) [@RX14](https://forum.crystal-lang.org/u/RX14)\
**Post date:** [January 10, 2019, 11:17am UTC](https://forum.crystal-lang.org/t/throw-and-catch/256/2 "2019-01-10T11:17:09Z")

</div>

It’s bad practice. You should separate parts out into functions and use `return` if you want to do this. Or raise an exception.

---

<div class="post-metadata">

**Author:** ![vladfaust](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/vladfaust/32/48_2.png) [@vladfaust](https://forum.crystal-lang.org/u/vladfaust)\
**Post date:** [January 10, 2019, 11:52am UTC](https://forum.crystal-lang.org/t/throw-and-catch/256/3 "2019-01-10T11:52:53Z")

</div>

_Tries to dislike the post_

---

<div class="post-metadata">

**Author:** ![RX14](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/rx14/32/633_2.png) [@RX14](https://forum.crystal-lang.org/u/RX14)\
**Post date:** [January 10, 2019, 12:38pm UTC](https://forum.crystal-lang.org/t/throw-and-catch/256/4 "2019-01-10T12:38:08Z")

</div>

for a more objective reason: it’d probably be impossible to typecheck. It’s basically `goto`.
