Skip to content

Commit

Permalink
Better SeekFrom::End error message
Browse files Browse the repository at this point in the history
  • Loading branch information
pka committed Sep 1, 2023
1 parent 5a9c3dc commit fb1cac7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/buffered_range_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,9 +230,11 @@ pub(crate) mod sync {
self.buffer.offset = p as usize;
Ok(p)
}
// TODO: we should support SeekFrom::End (e.g. for Parquet)
// With a HEAD request we would often get the file length
SeekFrom::End(_) => Err(std::io::Error::new(
std::io::ErrorKind::Other,
"Request size unkonwn",
"SeekFrom::End not supported for HTTP streams",
)),
SeekFrom::Current(p) => {
self.buffer.offset = self.buffer.offset.saturating_add_signed(p as isize);
Expand Down

0 comments on commit fb1cac7

Please sign in to comment.