This commit is contained in:
rewin
2024-03-27 23:23:26 +03:00
parent bb9bd4e9f4
commit 6c6570a6d3
11 changed files with 77 additions and 56 deletions
+6 -6
View File
@@ -21,10 +21,10 @@ impl RemoteAssetReader {
let token = path
.ext_file_prefix()
.ok_or_else(|| {
AssetReaderError::Io(std::io::Error::new(
AssetReaderError::Io(Arc::new(std::io::Error::new(
ErrorKind::Other,
format!("Failed to parse token from '{path:?}'"),
))
)))
})?
.to_str()
.unwrap();
@@ -40,10 +40,10 @@ impl RemoteAssetReader {
.json::<GetMediaFileSuccessResponse>()
.await
.map_err(IntoError::<AssetReaderError>::into),
other => Err(AssetReaderError::Io(std::io::Error::new(
other => Err(AssetReaderError::Io(Arc::new(std::io::Error::new(
ErrorKind::Other,
format!("Status Code from endpoint: {other}"),
))),
)))),
}?;
let url = format!(
@@ -69,10 +69,10 @@ impl RemoteAssetReader {
.map_err(IntoError::<AssetReaderError>::into)?
.into_iter()
.collect::<Vec<_>>()),
other => Err(AssetReaderError::Io(std::io::Error::new(
other => Err(AssetReaderError::Io(Arc::new(std::io::Error::new(
ErrorKind::Other,
format!("Status Code from bucket URL: {other}"),
))),
)))),
}?;
let reader: Box<Reader> = Box::new(VecReader::new(bytes));