You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by "zwpaper (via GitHub)" <gi...@apache.org> on 2023/03/23 03:02:59 UTC

[GitHub] [incubator-opendal] zwpaper opened a new issue, #1732: Should return error with more detail

zwpaper opened a new issue, #1732:
URL: https://github.com/apache/incubator-opendal/issues/1732

   context: https://discord.com/channels/1081052318650339399/1081052319342407715/1087747871656390807
   
   when using `Operator.list`, we check whether the input is dir by detecting the tailing `/`,
   it is documented here https://github.com/apache/incubator-opendal/blob/main/core/src/types/operator/operator.rs#L786,
   
   but it still is easy to be ignored.
   
   as the context discussed, we could enhance the Error to improve the readability.
   
   possible solution:
   1. add a new type like `UnexpectedPath` or `InvalidPath`
   2. add more detail to the `NotADirectory` error
   
   after checking the code, We already had error messages with the error type, we could let the validate_path https://github.com/apache/incubator-opendal/blob/04ca6e5c29f5ddd637f4633f987fe7f5eadc3751/core/src/raw/path.rs#L215 return specific error, so that we can know the details
   
   WDYT @Xuanwo 


-- 
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.apache.org

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


[GitHub] [incubator-opendal] Xuanwo commented on issue #1732: Should return error with more detail for `validate_path`

Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo commented on issue #1732:
URL: https://github.com/apache/incubator-opendal/issues/1732#issuecomment-1483024128

   Great!


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


[GitHub] [incubator-opendal] Xuanwo commented on issue #1732: Should return error with more detail for `validate_path`

Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo commented on issue #1732:
URL: https://github.com/apache/incubator-opendal/issues/1732#issuecomment-1480902986

   > @Xuanwo the only difference is error message?
   
   `ErrorKind`, `operation` are also different.


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


[GitHub] [incubator-opendal] Xuanwo commented on issue #1732: Should return error with more detail for `validate_path`

Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo commented on issue #1732:
URL: https://github.com/apache/incubator-opendal/issues/1732#issuecomment-1482967612

   The discussion seems to be going in the wrong direction. We want to inform our users that the error (`NotADirectory` or `IsADirectory`) is caused by an incorrect input path. We can modify the error description to improve its clarity and effectiveness.


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


[GitHub] [incubator-opendal] zwpaper commented on issue #1732: Should return error with more detail for `validate_path`

Posted by "zwpaper (via GitHub)" <gi...@apache.org>.
zwpaper commented on issue #1732:
URL: https://github.com/apache/incubator-opendal/issues/1732#issuecomment-1483015577

   yes, that's what I expecting, how about 
   ```
   the path trying to list should end with `/`
   ```
   
   as `ErrorKind::NotADirectory` has shown the meaning `not a directory`


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


[GitHub] [incubator-opendal] Xuanwo closed issue #1732: Should return error with more detail for `validate_path`

Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo closed issue #1732: Should return error with more detail for `validate_path`
URL: https://github.com/apache/incubator-opendal/issues/1732


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


[GitHub] [incubator-opendal] Xuanwo commented on issue #1732: Should return error with more detail for `validate_path`

Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo commented on issue #1732:
URL: https://github.com/apache/incubator-opendal/issues/1732#issuecomment-1480541542

   > 2. add more detail to the `NotADirectory` error
   
   We can start from this way first!
   
   https://github.com/apache/incubator-opendal/blob/04ca6e5c29f5ddd637f4633f987fe7f5eadc3751/core/src/types/operator/blocking_operator.rs#L296-L303
   
   Adding more accurate message instead of `read path is not a directory` will be helpful.


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


[GitHub] [incubator-opendal] zwpaper commented on issue #1732: Should return error with more detail for `validate_path`

Posted by "zwpaper (via GitHub)" <gi...@apache.org>.
zwpaper commented on issue #1732:
URL: https://github.com/apache/incubator-opendal/issues/1732#issuecomment-1481302337

   did I misunderstand you? @Xuanwo 
   
   it looks like the 2 have the same ErrorKind and operation is mean to be different, one for `list` and other `create_dir`
   
   https://github.com/apache/incubator-opendal/blob/04ca6e5c29f5ddd637f4633f987fe7f5eadc3751/core/src/types/operator/blocking_operator.rs#L296-L303
   
   https://github.com/apache/incubator-opendal/blob/main/core/src/types/operator/operator.rs#L818-L826


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


[GitHub] [incubator-opendal] zwpaper commented on issue #1732: Should return error with more detail for `validate_path`

Posted by "zwpaper (via GitHub)" <gi...@apache.org>.
zwpaper commented on issue #1732:
URL: https://github.com/apache/incubator-opendal/issues/1732#issuecomment-1480901267

   @Xuanwo the only difference is error message?


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