fresh-borzoni commented on code in PR #302:
URL: https://github.com/apache/fluss-rust/pull/302#discussion_r2799435281
##########
bindings/cpp/include/fluss.hpp:
##########
@@ -46,6 +46,134 @@ struct UpsertWriter;
struct Lookuper;
} // namespace ffi
+/// Named constants for Fluss API error codes.
+///
+/// Server API errors have error_code > 0 or == -1.
+/// Client-side errors have error_code == CLIENT_ERROR (-2).
+/// These constants match the Rust core FlussError enum and are stable across
protocol versions.
+/// New server error codes work automatically (error_code is a raw int, not a
closed enum) —
+/// these constants are convenience names, not an exhaustive list.
+struct ErrorCode {
+ /// Client-side error (not from server API protocol). Check error_message
for details.
+ static constexpr int CLIENT_ERROR = -2;
+ /// The server experienced an unexpected error when processing the request.
+ static constexpr int UNKNOWN_SERVER_ERROR = -1;
+ /// The server disconnected before a response was received.
+ static constexpr int NETWORK_EXCEPTION = 1;
Review Comment:
well, None means 'no error', so it's like a Rust core sentinel, but we may
add it to match :)
--
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]