# Catching "invalid enum value" errors

**URL:** <https://ziggit.dev/t/catching-invalid-enum-value-errors/2206>\
**Category:** Help\
**Tags:** language\
**Created:** [November 15, 2023, 8:03am UTC](https://ziggit.dev/t/catching-invalid-enum-value-errors/2206 "2023-11-15T08:03:50Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

**Author:** ![BratishkaErik](https://ziggit.dev/user_avatar/ziggit.dev/bratishkaerik/32/1222_2.png) [@BratishkaErik](https://ziggit.dev/u/BratishkaErik)\
**Post date:** [November 16, 2023, 9:16pm UTC](https://ziggit.dev/t/catching-invalid-enum-value-errors/2206/11 "2023-11-16T21:16:59Z")

</div>

> [@chung-leong](#):
>
> Non-exhaustive enums don’t work with EnumSet. It’s too big of a trade-off in my opinion.

BTW fix for this is planned on my TODO list for a long time (for now I just re-implement smaller subset of what I need from std.enums for non-exhaustive enums). If I understand correctly, this restriction was relevant when one type of enumerations were allowed to have field aliases (now-removed extern enums), and since we don’t have them anymore this restriction can be lifted.

Related:  
[Add some enum utilities by SpexGuy · Pull Request #8171 · ziglang/zig · GitHub](https://github.com/ziglang/zig/pull/8171) (original PR that introduced std.enums, merged March 19, 2021)  
[enums should disallow multiple enumerations with the same value · Issue #2115 · ziglang/zig · GitHub](https://github.com/ziglang/zig/issues/2115#issuecomment-827968279) (proposal to remove extern enums, April 28, 2021, also note about time complexity of std.enums.directEnumArray on a extern enum)

---

_[View the full topic](https://ziggit.dev/t/catching-invalid-enum-value-errors/2206)._
