My program reads a line such as baud=115200 from a configuration file and converts the number with std.fmt.parseInt(u32, text, 10). The result cannot be used directly: the compiler says the value is an error union, not a u32. I have seen try, catch, catch unreachable and if (...) |v| {} else |err| {} in examples and I am not sure which one is appropriate where.
What is the difference between them, and how do I fall back to a default of 9600 when the text is not a valid number?




