File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,8 @@ pub struct GithubTree {
4646#[ derive( Debug , Deserialize ) ]
4747pub struct RestRepository {
4848 pub id : usize ,
49- #[ allow( unused, reason = "Useful for debugging, if something does go wrong" ) ]
49+ // Useful for debugging, if something does go wrong
50+ #[ allow( unused) ]
5051 pub full_name : String ,
5152 pub node_id : String ,
5253 pub fork : bool ,
@@ -56,6 +57,7 @@ pub struct RestRepository {
5657struct GraphResponse < T > {
5758 data : Option < T > ,
5859 errors : Option < Vec < GitHubError > > ,
60+ #[ allow( unused) ]
5961 message : Option < String > ,
6062}
6163
@@ -183,7 +185,14 @@ impl Github {
183185 let data: GraphResponse < T > = handle_response_json ( resp) . await ?;
184186
185187 if let Some ( errs) = data. errors {
186- warn ! ( "GraphQL Errors: {:?}, \n {:#?}" , data. message, errs) ;
188+ let errs: Vec < _ > = errs
189+ . into_iter ( )
190+ // Some repos on GitHub are just marked as NOT_FOUND, does not seem like our fault
191+ . filter ( |el| el. r#type . as_deref ( ) != Some ( "NOT_FOUND" ) )
192+ . collect ( ) ;
193+ if !errs. is_empty ( ) {
194+ warn ! ( "GraphQL Errors: \n {:#?}" , errs) ;
195+ }
187196 }
188197
189198 data. data . ok_or_else ( || Error :: EmptyData )
You can’t perform that action at this time.
0 commit comments