From ceaad382e902be35656f623e7eea7907f69ea48b Mon Sep 17 00:00:00 2001 From: Meghan Denny Date: Fri, 30 Jun 2023 01:48:13 -0700 Subject: [PATCH] callback: print status when not OK --- src/lib.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib.zig b/src/lib.zig index b37e146e3f13b1a5d8665da2ffa5c442d002b6f6..f7a69ccf59185840f692278f94e1802fae1a877c 100644 --- a/src/lib.zig +++ b/src/lib.zig @@ -273,7 +273,7 @@ pub fn Handlers(comptime T: type) type { try req.do(.POST, headers, try params.encode()); const r = req.reader(); const body_content = try r.readAllAlloc(alloc, 1024 * 1024 * 5); - if (req.status != .ok) std.log.scoped(.oauth).debug("{s}", .{body_content}); + if (req.status != .ok) std.log.scoped(.oauth).debug("{s}: {s}", .{ @tagName(req.status), body_content }); if (req.status != .ok) return error.OauthBadToken; const val = try extras.parse_json(alloc, body_content); @@ -287,7 +287,7 @@ pub fn Handlers(comptime T: type) type { try req2.do(.GET, headers2, null); const r2 = req2.reader(); const body_content2 = try r2.readAllAlloc(alloc, 1024 * 1024 * 5); - if (req2.status != .ok) std.log.scoped(.oauth).debug("{s}", .{body_content2}); + if (req2.status != .ok) std.log.scoped(.oauth).debug("{s}: {s}", .{ @tagName(req2.status), body_content2 }); if (req2.status != .ok) return error.OauthBadUserinfo; const val2 = try extras.parse_json(alloc, body_content2); -- 2.54.0