diff options
Diffstat (limited to 'gitolfs3-server/src/handler.rs')
| -rw-r--r-- | gitolfs3-server/src/handler.rs | 18 |
1 files changed, 17 insertions, 1 deletions
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 { | |||
| 42 | impl AppState { | 42 | impl AppState { |
| 43 | async fn check_object(&self, repo: &str, obj: &BatchRequestObject) -> Result<ObjectStatus, ()> { | 43 | async fn check_object(&self, repo: &str, obj: &BatchRequestObject) -> Result<ObjectStatus, ()> { |
| 44 | let (oid0, oid1) = (HexByte(obj.oid[0]), HexByte(obj.oid[1])); | 44 | let (oid0, oid1) = (HexByte(obj.oid[0]), HexByte(obj.oid[1])); |
| 45 | let full_path = format!("{repo}/lfs/objects/{}/{}/{}", oid0, oid1, obj.oid); | 45 | let full_path = format!("{repo}/lfs/objects/{oid0}/{oid1}/{}", obj.oid); |
| 46 | 46 | ||
| 47 | let result = match self | 47 | let result = match self |
| 48 | .s3_client | 48 | .s3_client |
| @@ -57,6 +57,14 @@ impl AppState { | |||
| 57 | Err(SdkError::ServiceError(e)) if e.err().is_not_found() => { | 57 | Err(SdkError::ServiceError(e)) if e.err().is_not_found() => { |
| 58 | return Ok(ObjectStatus::DoesNotExist); | 58 | return Ok(ObjectStatus::DoesNotExist); |
| 59 | } | 59 | } |
| 60 | Err(SdkError::ServiceError(e)) => { | ||
| 61 | println!( | ||
| 62 | "Failed to HeadObject (repo {repo}, OID {}): {}", | ||
| 63 | e.err(), | ||
| 64 | obj.oid | ||
| 65 | ); | ||
| 66 | return Err(()); | ||
| 67 | } | ||
| 60 | Err(e) => { | 68 | Err(e) => { |
| 61 | println!("Failed to HeadObject (repo {repo}, OID {}): {e}", obj.oid); | 69 | println!("Failed to HeadObject (repo {repo}, OID {}): {e}", obj.oid); |
| 62 | return Err(()); | 70 | return Err(()); |
| @@ -270,6 +278,14 @@ pub async fn handle_obj_download( | |||
| 270 | .await | 278 | .await |
| 271 | { | 279 | { |
| 272 | Ok(result) => result, | 280 | Ok(result) => result, |
| 281 | Err(SdkError::ServiceError(e)) => { | ||
| 282 | println!("Failed to GetObject (repo {repo}, OID {oid}): {}", e.err()); | ||
| 283 | return ( | ||
| 284 | http::StatusCode::INTERNAL_SERVER_ERROR, | ||
| 285 | "Failed to query object information", | ||
| 286 | ) | ||
| 287 | .into_response(); | ||
| 288 | }, | ||
| 273 | Err(e) => { | 289 | Err(e) => { |
| 274 | println!("Failed to GetObject (repo {repo}, OID {oid}): {e}"); | 290 | println!("Failed to GetObject (repo {repo}, OID {oid}): {e}"); |
| 275 | return ( | 291 | return ( |