mirror of
https://codeberg.org/ziglings/exercises.git
synced 2026-06-08 07:50:00 +00:00
Update 033_iferror.zig
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user