Ji-Xinyou commented on code in PR #1861:
URL:
https://github.com/apache/incubator-opendal/pull/1861#discussion_r1159962999
##########
bindings/c/include/opendal.h:
##########
@@ -25,14 +25,229 @@
#include <stddef.h>
#include <stdbool.h>
+/*
+ The C-compatible error type enum used in c bindings.
+ NOTICE: the type definition of [`ErrorNo`] should be aligned with
+ [`od::ErrorKind`]
+ */
+typedef enum opendal_errno {
+ /*
+ returning it back. For example, s3 returns an internal service error.
+ */
+ Unexpected,
+ /*
+ Underlying service doesn't support this operation.
+ */
+ Unsupported,
+ /*
+ The config for backend is invalid.
+ */
+ ConfigInvalid,
+ /*
+ The given path is not found.
+ */
+ NotFound,
+ /*
+ The given path doesn't have enough permission for this operation
+ */
+ PermissionDenied,
+ /*
+ The given path is a directory.
+ */
+ IsADirectory,
+ /*
+ The given path is not a directory.
+ */
+ NotADirectory,
+ /*
+ The given path already exists thus we failed to the specified operation on
it.
+ */
+ AlreadyExists,
+ /*
+ Requests that sent to this path is over the limit, please slow down.
+ */
+ RateLimited,
+ /*
+ The given file paths are same.
+ */
+ IsSameFile,
+ /*
+ Unknown error, since [`opendal::ErrorKind`] is nonexhaustive
+ */
+ UnknownError,
+ /*
+ NullPtr error, meaning that a provided pointer which need to be
dereferenced is null
+ */
+ NullPtr,
Review Comment:
When user passing arguments like `path` and `scheme`, they are passing a
pointer to the cstring. If the pointer points to nullspace, this error is
returned.
I added this because no current ErrorKind can express the meaning of the
error of dereferencing a nullptr. wdyt?
--
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]