# When ArgumentError should be thrown?

**URL:** <https://discourse.julialang.org/t/when-argumenterror-should-be-thrown/26116>\
**Category:** General Usage\
**Tags:** question\
**Created:** [July 7, 2019, 2:38pm UTC](https://discourse.julialang.org/t/when-argumenterror-should-be-thrown/26116 "2019-07-07T14:38:03Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![dawbarton](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dawbarton/32/215461_2.png) [@dawbarton](https://discourse.julialang.org/u/dawbarton)\
**Post date:** [July 10, 2019, 4:09pm UTC](https://discourse.julialang.org/t/when-argumenterror-should-be-thrown/26116/5 "2019-07-10T16:09:58Z")

</div>

For reference you might also want to have a look at this old thread: [Please stop using `error` and `ErrorException` in packages (and Base)](https://discourse.julialang.org/t/please-stop-using-error-and-errorexception-in-packages-and-base/12096). My general feeling from that thread was that there isn’t really a consensus on how exceptions should be used, though personally I don’t use them for flow control for the reason that Tamas laid out (expense).

---

_[View the full topic](https://discourse.julialang.org/t/when-argumenterror-should-be-thrown/26116)._
