better error messages
s-ol
1 year, 10 months ago
4 | 4 | |
5 | 5 | fn verify_args(expected: u8, got: []const u8) !void { |
6 | 6 | for (got) |typ| { |
7 | if (typ != expected) | |
7 | if (typ != expected) { | |
8 | std.debug.warn("expected '{c}' but got '{c}' element (expected {})\n", .{expected, typ, got}); | |
8 | 9 | return error.typeMismatch; |
10 | } | |
9 | 11 | } |
10 | 12 | } |
11 | 13 | |
180 | 182 | } |
181 | 183 | |
182 | 184 | self.set_uniform(path[1..], argv, argc, types) catch |err| { |
183 | std.debug.warn("{}\n", .{err}); | |
185 | std.debug.warn("{} while processing {}\n", .{err, path}); | |
184 | 186 | }; |
185 | 187 | return 0; |
186 | 188 | } |