Skip to content

Commit 3eeb856

Browse files
Catch bad status code in namereq getter
1 parent 22a1783 commit 3eeb856

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/endpoint.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ pub(crate) async fn get_outstanding_namereqs(globals: &Globals) -> Result<Vec<Na
3737
.send()
3838
.await?;
3939

40+
let status_code = resp.status();
41+
if !status_code.is_success() {
42+
return Err(format!("OFAPI error: {} {}", endpoint, status_code).into());
43+
}
44+
4045
let body = resp.json().await?;
4146
Ok(body)
4247
}

0 commit comments

Comments
 (0)