Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: bolcom/libunftp
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 424f23e4bb6c8c09b48971839edbbe82e5f807ef
Choose a base ref
..
head repository: bolcom/libunftp
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 5054fce94823b917f4ff42c21c91f2c71c0b8ac8
Choose a head ref
Showing with 6 additions and 3 deletions.
  1. +6 −3 crates/unftp-sbe-gcs/src/gcs_client.rs
9 changes: 6 additions & 3 deletions crates/unftp-sbe-gcs/src/gcs_client.rs
Original file line number Diff line number Diff line change
@@ -302,17 +302,20 @@ impl GcsClient {
request = request.header(*hk, *hv);
}

// If we can't create a request, we return a LocalError
// If our request fails (not even a Http error), we return a TransientFileNotAvailable
// Both are retryable 4xx's but this seems a more appropriate mapping
let response = match body {
Some(body) => match body {
Either::Left(body) => {
let request = request.method(method).body(body).map_err(|e| Error::new(ErrorKind::LocalError, e))?;

self.client_string.request(request).await.map_err(|e| Error::new(ErrorKind::LocalError, e))?
self.client_string.request(request).await.map_err(|e| Error::new(ErrorKind::TransientFileNotAvailable, e))?
}
Either::Right(body) => {
let request = request.method(method).body(body).map_err(|e| Error::new(ErrorKind::LocalError, e))?;

self.client_stream.request(request).await.map_err(|e| Error::new(ErrorKind::LocalError, e))?
self.client_stream.request(request).await.map_err(|e| Error::new(ErrorKind::TransientFileNotAvailable, e))?
}
},
None => {
@@ -321,7 +324,7 @@ impl GcsClient {
.body(Empty::<Bytes>::new())
.map_err(|e| Error::new(ErrorKind::LocalError, e))?;

self.client_empty.request(request).await.map_err(|e| Error::new(ErrorKind::LocalError, e))?
self.client_empty.request(request).await.map_err(|e| Error::new(ErrorKind::TransientFileNotAvailable, e))?
}
};