feat: add thumbnail spec

This commit is contained in:
2026-01-20 20:11:27 -08:00
parent 2bc6d1bdb0
commit 09f6f49390
7 changed files with 22 additions and 9 deletions

View File

@@ -42,7 +42,6 @@ pub async fn get_repos(
.into_iter()
.map(|r| r.id)
.collect::<HashSet<String>>();
println!("{added_ids:?}");
let data = response
.json::<Vec<Repository>>()
.await?

View File

@@ -33,7 +33,9 @@ pub async fn proxy_file(
.bearer_auth(token)
.send()
.await?;
response.error_for_status_ref()?;
response
.error_for_status_ref()
.map_err(|_| crate::error::Error::NotFound)?;
let bytes = response.bytes().await?;
let mime = mime_guess::from_path(&path.file)

View File

@@ -54,7 +54,9 @@ impl ResponseError for Error {
Error::ValidationFailed(msg) => {
HttpResponse::BadRequest().json(ErrorResponse { error: msg.clone() })
}
Error::NotFound => HttpResponse::NotFound().finish(),
Error::NotFound => HttpResponse::NotFound().json(ErrorResponse {
error: "not found".to_string(),
}),
_ => HttpResponse::InternalServerError().finish(),
}
}