# New syntax suggestion: catch with type specs

**URL:** https://discourse.julialang.org/t/new-syntax-suggestion-catch-with-type-specs/101840
**Category:** Internals & Design
**Tags:** exception
**Created:** [July 20, 2023, 1:51pm UTC](https://discourse.julialang.org/t/new-syntax-suggestion-catch-with-type-specs/101840 "2023-07-20T13:51:14Z")
**Posts on this page:** 1
**Showing post:** 7

<div class="post-metadata">

### Author: ![jar1](https://avatars.discourse-cdn.com/v4/letter/j/c0e974/32.png) [@jar1](https://discourse.julialang.org/u/jar1)
#### Post date: [July 20, 2023, 8:40pm UTC](https://discourse.julialang.org/t/new-syntax-suggestion-catch-with-type-specs/101840/7 "2023-07-20T20:40:24Z")

</div>

I am opposed to this change because it encourages the use of exceptions for expected errors. IMO exceptions should be used for unexpected errors, and another system should be introduced for producing and handling failure values. Python uses exceptions for control flow; I don’t think Julia should.

Meanwhile `switch`/`case` is a primitive implementation of pattern matching, which has been implemented much more generally with [`@match`](https://thautwarm.github.io/MLStyle.jl/latest/syntax/pattern.html).

---

_[View the full topic](https://discourse.julialang.org/t/new-syntax-suggestion-catch-with-type-specs/101840)._
