Update 033_iferror.zig
This commit is contained in:
parent
84c9c4072c
commit
32ff7cf42a
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
|
// We'll take it even further and use a switch statement to handle
|
||||||
// the error types.
|
// the error types.
|
||||||
//
|
//
|
||||||
|
// if (foo) |value| {
|
||||||
|
// ...
|
||||||
|
// } else |err| switch(err) {
|
||||||
|
// ...
|
||||||
|
// }
|
||||||
|
//
|
||||||
const MyNumberError = error{
|
const MyNumberError = error{
|
||||||
TooBig,
|
TooBig,
|
||||||
TooSmall,
|
TooSmall,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue