Xuanwo commented on code in PR #2832:
URL: 
https://github.com/apache/incubator-opendal/pull/2832#discussion_r1288508125


##########
bin/oay/src/services/webdav/webdavfs.rs:
##########
@@ -73,8 +75,96 @@ impl DavFileSystem for WebdavFs {
         path: &'a dav_server::davpath::DavPath,
     ) -> dav_server::fs::FsFuture<Box<dyn dav_server::fs::DavMetaData>> {
         async move {
-            let opendal_metadata = 
self.op.stat(path.as_url_string().as_str()).await.unwrap();
-            Ok(Box::new(WebdavMetaData::new(opendal_metadata)) as Box<dyn 
DavMetaData>)
+            let opendal_metadata = 
self.op.stat(path.as_url_string().as_str()).await;
+            match opendal_metadata {
+                Ok(metadata) => {
+                    let webdav_metadata = WebdavMetaData::new(metadata);
+                    Ok(Box::new(webdav_metadata) as Box<dyn DavMetaData>)
+                }
+                Err(e) => Err(convert_error(e)),
+            }
+        }
+        .boxed()
+    }
+
+    fn create_dir<'a>(&'a self, path: &'a DavPath) -> 
dav_server::fs::FsFuture<()> {

Review Comment:
   Can we omit those lifetime hint?



##########
bin/oay/src/services/webdav/webdav_file.rs:
##########
@@ -83,7 +83,7 @@ impl DavFile for WebdavFile {
     }
 }
 
-fn convert_error(opendal_error: opendal::Error) -> dav_server::fs::FsError {
+pub fn convert_error(opendal_error: opendal::Error) -> dav_server::fs::FsError 
{

Review Comment:
   We can implement `From<opendal::Error> for dav_server::fs::FsError`



-- 
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]

Reply via email to