Return 404 from API if no user is found

Co-Authored-By: Antonio Scandurra <me@as-cii.com>
This commit is contained in:
Nathan SoboandAntonio Scandurra committed 2022-05-18 10:32:58 -06:00
1 parent 597e0563fa
commit 0331fdef6d
1 file changed
+1 -1
+1 -1
View File
@@ -135,7 +135,7 @@ async fn get_user(
.db
.get_user_by_github_login(&login)
.await?
.ok_or_else(|| anyhow!("user not found"))?;
.ok_or_else(|| Error::Http(StatusCode::NOT_FOUND, "User not found".to_string()))?;
Ok(Json(user))
}