mirror of
https://codeberg.org/andyscott/ziglings.git
synced 2024-11-08 11:20:46 -05:00
Update 033_iferror.zig
This commit is contained in:
parent
1c14338573
commit
1b2b90317c
1 changed files with 6 additions and 0 deletions
|
@ -15,6 +15,12 @@
|
|||
// We'll take it even further and use a switch statement to handle
|
||||
// the error types.
|
||||
//
|
||||
// if (foo) |value| {
|
||||
// ...
|
||||
// } else |err| switch(err) {
|
||||
// ...
|
||||
// }
|
||||
//
|
||||
const MyNumberError = error{
|
||||
TooBig,
|
||||
TooSmall,
|
||||
|
|
Loading…
Reference in a new issue