Xuanwo commented on code in PR #1861:
URL:
https://github.com/apache/incubator-opendal/pull/1861#discussion_r1159970488
##########
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:
Think too much before we don't have real users is not a good thing to me.
Let's keep moving.
--
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]