authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2023-06-30 01:48:13 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2023-06-30 01:48:13 -07:00
logceaad382e902be35656f623e7eea7907f69ea48b
treee33b0c2877410e72b95ba47c8425f781b772809c
parentd42c35735aa70b5143afc24373daaebf6a66b631

callback: print status when not OK


1 files changed, 2 insertions(+), 2 deletions(-)

src/lib.zig+2-2
...@@ -273,7 +273,7 @@ pub fn Handlers(comptime T: type) type {...@@ -273,7 +273,7 @@ pub fn Handlers(comptime T: type) type {
273 try req.do(.POST, headers, try params.encode());273 try req.do(.POST, headers, try params.encode());
274 const r = req.reader();274 const r = req.reader();
275 const body_content = try r.readAllAlloc(alloc, 1024 * 1024 * 5);275 const body_content = try r.readAllAlloc(alloc, 1024 * 1024 * 5);
276 if (req.status != .ok) std.log.scoped(.oauth).debug("{s}", .{body_content});276 if (req.status != .ok) std.log.scoped(.oauth).debug("{s}: {s}", .{ @tagName(req.status), body_content });
277 if (req.status != .ok) return error.OauthBadToken;277 if (req.status != .ok) return error.OauthBadToken;
278 const val = try extras.parse_json(alloc, body_content);278 const val = try extras.parse_json(alloc, body_content);
279279
...@@ -287,7 +287,7 @@ pub fn Handlers(comptime T: type) type {...@@ -287,7 +287,7 @@ pub fn Handlers(comptime T: type) type {
287 try req2.do(.GET, headers2, null);287 try req2.do(.GET, headers2, null);
288 const r2 = req2.reader();288 const r2 = req2.reader();
289 const body_content2 = try r2.readAllAlloc(alloc, 1024 * 1024 * 5);289 const body_content2 = try r2.readAllAlloc(alloc, 1024 * 1024 * 5);
290 if (req2.status != .ok) std.log.scoped(.oauth).debug("{s}", .{body_content2});290 if (req2.status != .ok) std.log.scoped(.oauth).debug("{s}: {s}", .{ @tagName(req2.status), body_content2 });
291 if (req2.status != .ok) return error.OauthBadUserinfo;291 if (req2.status != .ok) return error.OauthBadUserinfo;
292 const val2 = try extras.parse_json(alloc, body_content2);292 const val2 = try extras.parse_json(alloc, body_content2);
293293