| ... | @@ -5091,11 +5091,10 @@ fn deferErrorExample(is_error: bool) !void { | ... | @@ -5091,11 +5091,10 @@ fn deferErrorExample(is_error: bool) !void { |
| 5091 | } | 5091 | } |
| 5092 | } | 5092 | } |
| 5093 | | 5093 | |
| 5094 | // The errdefer keyword support also an alternative syntax to capture the | 5094 | // The errdefer keyword also supports an alternative syntax to capture the |
| 5095 | // error generated in case of one error. | 5095 | // generated error. |
| 5096 | // | 5096 | // |
| 5097 | // This is useful when during the clean up after an error additional | 5097 | // This is useful for printing an additional error message during clean up. |
| 5098 | // message want to be printed. | | |
| 5099 | fn deferErrorCaptureExample() !void { | 5098 | fn deferErrorCaptureExample() !void { |
| 5100 | errdefer |err| { | 5099 | errdefer |err| { |
| 5101 | std.debug.print("the error is {s}\n", .{@errorName(err)}); | 5100 | std.debug.print("the error is {s}\n", .{@errorName(err)}); |