# Sema: improve error set/union discard/ignore errors · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/9ae43567a3ef14a815482ccaa2a5b412a716743e)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 9ae43567a3ef14a815482ccaa2a5b412a716743e

Requested commit: 9ae43567a3ef14a815482ccaa2a5b412a716743e

Commit: 9ae43567a3ef14a815482ccaa2a5b412a716743e

Tree: cdd535a650d7fdde5eb6c43e1d8e2b040fee5366

Author: r00ster91

Committer: wooster0

## Message

```
Sema: improve error set/union discard/ignore errors

Previously the error had a note suggesting to use `try`, `catch`, or
`if`, even for error sets where none of those work.
Instead, in case of an error set the way you can handle the error
depends very much on the specific case. For example you might be in a
`catch` where you are discarding or ignoring the error set capture
value, in which case one way to handle the error might be to `return`
the error.
So, in that case, we do not attach that error note.

Additionally, this makes the error tell you what kind of an error it is:
is it an error set or an error union? This distinction is very relevant
in how to handle the error.

```

## Parents

- [8579904ddd489b73cb61721c31b9e9c14ed9e264](https://git.cafe/gitcafe/zig/commit/8579904ddd489b73cb61721c31b9e9c14ed9e264?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/9ae43567a3ef14a815482ccaa2a5b412a716743e?format=markdown)
