# 2 kinds of terminating errors

**URL:** <https://forums.powershell.org/t/2-kinds-of-terminating-errors/13046>\
**Category:** PowerShell Help\
**Created:** [August 23, 2019, 11:55am UTC](https://forums.powershell.org/t/2-kinds-of-terminating-errors/13046 "2019-08-23T11:55:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![js2010](https://avatars.discourse-cdn.com/v4/letter/j/ebca7d/32.png) [@js2010](https://forums.powershell.org/u/js2010)\
**Post date:** [August 23, 2019, 11:55am UTC](https://forums.powershell.org/t/2-kinds-of-terminating-errors/13046/1 "2019-08-23T11:55:49Z")

</div>

There’s 2 kinds of terminating errors now, script and statement (“nonterminating terminating errors”)? Ugh, powershell is so weird and hard to know. [https://github.com/MicrosoftDocs/PowerShell-Docs/issues/1583](https://github.com/MicrosoftDocs/PowerShell-Docs/issues/1583)

---

<div class="post-metadata">

**Author:** ![ta11ow](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/ta11ow/32/131_2.png) [@ta11ow](https://forums.powershell.org/u/ta11ow)\
**Post date:** [August 23, 2019, 12:30pm UTC](https://forums.powershell.org/t/2-kinds-of-terminating-errors/13046/2 "2019-08-23T12:30:38Z")

</div>

That’s a “sort of” from me.

But yeah, error handling is currently a bit messy. I’d love to see it cleaned up and sorted out for PS7, but it doesn’t seem like that’s super likely at this point in time.

I’ve found that at least when working with my own code, if I’m consistent in how I throw errors I generally have a better time dealing with it and get the results I expect every time.

---

<div class="post-metadata">

**Author:** ![jasonrobertson](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/jasonrobertson/32/164_2.png) [@jasonrobertson](https://forums.powershell.org/u/jasonrobertson)\
**Post date:** [August 23, 2019, 12:32pm UTC](https://forums.powershell.org/t/2-kinds-of-terminating-errors/13046/3 "2019-08-23T12:32:40Z")

</div>

I agree with Joel on this.

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:31pm UTC](https://forums.powershell.org/t/2-kinds-of-terminating-errors/13046/4 "2024-05-16T20:31:46Z")

</div>


