Xuanwo commented on code in PR #2879:
URL:
https://github.com/apache/incubator-opendal/pull/2879#discussion_r1299185396
##########
bin/oay/src/services/webdav/webdavfs.rs:
##########
@@ -65,8 +65,13 @@ impl DavFileSystem for WebdavFs {
) -> dav_server::fs::FsFuture<dav_server::fs::FsStream<Box<dyn
dav_server::fs::DavDirEntry>>>
{
async move {
- let lister =
self.op.lister(path.as_url_string().as_str()).await.unwrap();
- Ok(DavStream::new(self.op.clone(), lister).boxed())
+ self.op
+ .lister(path.as_url_string().as_str())
+ .await
+ .map_or_else(
Review Comment:
The same.
##########
bin/oay/src/services/webdav/webdav_file.rs:
##########
@@ -39,25 +39,26 @@ impl DavFile for WebdavFile {
fn read_bytes(&mut self, count: usize) -> FsFuture<Bytes> {
async move {
let file_path = self.path.as_url_string();
- let content = self
- .op
+ self.op
.range_read(&file_path, 0..count as u64)
.await
- .unwrap();
- //error handle ?
- Ok(Bytes::from(content))
+ .map(Bytes::from)
+ .map_err(convert_error)
}
.boxed()
}
fn metadata(&mut self) -> FsFuture<Box<dyn DavMetaData>> {
async move {
- let opendal_metadata = self
- .op
+ self.op
.stat(self.path.as_url_string().as_str())
.await
- .unwrap();
- Ok(Box::new(WebdavMetaData::new(opendal_metadata)) as Box<dyn
DavMetaData>)
+ .map_or_else(
Review Comment:
also this.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]