I’ve got a large inferred error set that I am trying to prune down:
scanner.readEni(allocator, args.preop_timeout_us, false, args.pv_name_prefix) catch |err| switch (err) {
error.LinkError,
error.Overflow,
error.NoSpaceLeft,
error.OutOfMemory,
error.RecvTimeout,
error.Wkc,
error.StateChangeRefused,
error.StateChangeTimeout,
error.Timeout,
error.UnexpectedSubdevice,
error.InvalidSII,
error.InvalidMbxConfiguration,
error.CoENotSupported,
error.CoECompleteAccessNotSupported,
error.Emergency,
error.NotImplemented,
error.MbxOutFull,
error.InvalidMbxContent,
error.MbxTimeout,
error.Aborted,
error.WrongProtocol,
error.MissedFragment,
error.InvalidMailboxContent,
error.ObjectDoesNotExist,
error.InvalidCoE,
error.EndOfStream,
=> continue :bus_scan,
};
So I start by deleting error.EndOfStream
from the switch case so I can use compile errors to track down all the usages. However, the compile errors don’t really give me an error trace:
src/cli/run.zig:158:114: error: switch must handle all possibilities
break :blk scanner.readEni(allocator, args.preop_timeout_us, false, args.pv_name_prefix) catch |err| switch (err) {
^~~~~~
src/cli/run.zig:158:114: note: unhandled error value: 'error.EndOfStream'
referenced by:
main: src/cli/main.zig:62:39
main: /home/jeff/.config/Code/User/globalStorage/ziglang.vscode-zig/zig/x86_64-linux-0.14.1/lib/std/start.zig:660:37
comptime: /home/jeff/.config/Code/User/globalStorage/ziglang.vscode-zig/zig/x86_64-linux-0.14.1/lib/std/start.zig:58:30
start: /home/jeff/.config/Code/User/globalStorage/ziglang.vscode-zig/zig/x86_64-linux-0.14.1/lib/std/std.zig:97:27
comptime: /home/jeff/.config/Code/User/globalStorage/ziglang.vscode-zig/zig/x86_64-linux-0.14.1/lib/std/std.zig:168:9
error: the following command failed with 1 compilation errors:
It would be nice if the compiler could tell me where errors come from.