You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by "suyanhanx (via GitHub)" <gi...@apache.org> on 2023/08/19 04:28:46 UTC

[GitHub] [incubator-opendal] suyanhanx commented on a diff in pull request #2879: fix(oay): add some error handle

suyanhanx commented on code in PR #2879:
URL: https://github.com/apache/incubator-opendal/pull/2879#discussion_r1299081935


##########
bin/oay/src/services/webdav/webdav_dir_entry.rs:
##########
@@ -35,8 +36,10 @@ impl DavDirEntry for WebDAVDirEntry {
 
     fn metadata(&self) -> dav_server::fs::FsFuture<Box<dyn dav_server::fs::DavMetaData>> {
         async move {
-            let metedata = self.op.stat(self.dir_entry.path()).await.unwrap();
-            Ok(Box::new(WebdavMetaData::new(metedata)) as Box<dyn DavMetaData>)
+            self.op.stat(self.dir_entry.path()).await.map_or_else(

Review Comment:
   This is splitting `map_or_else` into `map` and `map_err`. As the  `map_err` part are the same, we may extract it.



-- 
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: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org