Skip to content

Commit

Permalink
add proper error message for not being able to parse provider
Browse files Browse the repository at this point in the history
  • Loading branch information
nektro committed Jan 25, 2022
1 parent 9c2a95d commit 1f0c59b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,9 @@ pub fn main() !void {
var clients = std.ArrayList(oauth2.Client).init(alloc);
for (flag.getMulti("oauth2-client") orelse @panic("missing required --oauth2-client flag")) |item| {
var iter = std.mem.split(u8, item, "|");
const pid = iter.next().?;
try clients.append(.{
.provider = oauth2.providerById(iter.next().?).?,
.provider = (try oauth2.providerById(alloc, pid)) orelse std.debug.panic("could not find provider by id: {s}", .{pid}),
.id = iter.next().?,
.secret = iter.next().?,
});
Expand Down
2 changes: 1 addition & 1 deletion zigmod.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ git https://github.com/nektro/zig-zorm commit-e5176e73203424da95a9d660648016d6f3
git https://github.com/vrischmann/zig-sqlite commit-b77453146b36299ace10da06f2d54264e0b3d376
git https://github.com/nektro/zig-extras commit-bdb6e6a326849bf3448ec5261e1392f8da8cef53
git https://github.com/leroycep/zig-jwt commit-137598749184c830ad07d9e5762b9db5e9a326c6
git https://github.com/nektro/zig-oauth2 commit-d9e27de43cebb036283df003e076b8f05fc0c7ef
git https://github.com/nektro/zig-oauth2 commit-bcc354a5a7c1edf16aa843048853f7f08a90a44e
git https://github.com/MasterQ32/zig-uri commit-01155026c8362bb75dcab10bafc31abff0c8bac4
git https://github.com/nektro/iguanaTLS commit-d49c382a52c2c10dee940d22c3e0a034d0cbac5a
git https://github.com/truemedian/zfetch commit-271cab5da4d12c8f08e67aa0cd5268da100e52f1
Expand Down

0 comments on commit 1f0c59b

Please sign in to comment.