File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -56,7 +56,8 @@ const Repository = struct {
5656 );
5757 defer client .allocator .free (response .body );
5858 if (response .status == .ok ) {
59- const authors = (try std .json .parseFromSliceLeaky (
59+ self .lines_changed = 0 ;
60+ const authors = std .json .parseFromSliceLeaky (
6061 []struct {
6162 author : struct { login : []const u8 },
6263 weeks : []struct {
@@ -67,8 +68,16 @@ const Repository = struct {
6768 arena .allocator (),
6869 response .body ,
6970 .{ .ignore_unknown_fields = true },
70- ));
71- self .lines_changed = 0 ;
71+ ) catch {
72+ // TODO: Replace with proper exception propagation when GitHub
73+ // gets their shit together and stops breaking this endpoint
74+ std .log .info (
75+ "Skipping lines changed by {s} in {s} due to invalid " ++
76+ "response from GitHub." ,
77+ .{ user , self .name },
78+ );
79+ return response .status ;
80+ };
7281 for (authors ) | o | {
7382 if (! std .mem .eql (u8 , o .author .login , user )) {
7483 continue ;
You can’t perform that action at this time.
0 commit comments