From b7e25baf29b210006c64e4fafe8523e0711e6f34 Mon Sep 17 00:00:00 2001 From: Rutger Broekhoff Date: Fri, 20 Feb 2026 18:17:35 +0100 Subject: Log more useful stuff when possible --- gitolfs3-server/src/handler.rs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'gitolfs3-server/src/handler.rs') diff --git a/gitolfs3-server/src/handler.rs b/gitolfs3-server/src/handler.rs index c5d4a61..ee52a31 100644 --- a/gitolfs3-server/src/handler.rs +++ b/gitolfs3-server/src/handler.rs @@ -42,7 +42,7 @@ enum ObjectStatus { impl AppState { async fn check_object(&self, repo: &str, obj: &BatchRequestObject) -> Result { let (oid0, oid1) = (HexByte(obj.oid[0]), HexByte(obj.oid[1])); - let full_path = format!("{repo}/lfs/objects/{}/{}/{}", oid0, oid1, obj.oid); + let full_path = format!("{repo}/lfs/objects/{oid0}/{oid1}/{}", obj.oid); let result = match self .s3_client @@ -57,6 +57,14 @@ impl AppState { Err(SdkError::ServiceError(e)) if e.err().is_not_found() => { return Ok(ObjectStatus::DoesNotExist); } + Err(SdkError::ServiceError(e)) => { + println!( + "Failed to HeadObject (repo {repo}, OID {}): {}", + e.err(), + obj.oid + ); + return Err(()); + } Err(e) => { println!("Failed to HeadObject (repo {repo}, OID {}): {e}", obj.oid); return Err(()); @@ -270,6 +278,14 @@ pub async fn handle_obj_download( .await { Ok(result) => result, + Err(SdkError::ServiceError(e)) => { + println!("Failed to GetObject (repo {repo}, OID {oid}): {}", e.err()); + return ( + http::StatusCode::INTERNAL_SERVER_ERROR, + "Failed to query object information", + ) + .into_response(); + }, Err(e) => { println!("Failed to GetObject (repo {repo}, OID {oid}): {e}"); return ( -- cgit v1.2.3