Skip to content

Commit ce74780

Browse files
committed
ignore NOT_FOUND errors
1 parent 9e1f87d commit ce74780

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/github/api.rs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ pub struct GithubTree {
4646
#[derive(Debug, Deserialize)]
4747
pub 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 {
5657
struct 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)

0 commit comments

Comments
 (0)