Migrate to the split error-handler API (zenoh-flat-jni #45)#495
Merged
Conversation
prebindgen split the generated JNI error callback into two channels: the
binding `JniErrorHandler.run(je)` (unchanged) and the typed domain
`ErrorHandler.run(message)` (`je` removed, called only on a domain `Err`).
A fallible flat wrapper now takes both — `onBindingError` then `onError`.
`JNIErrorHandlers.kt`:
- `throwZError` becomes the 1-arg domain handler
(`ErrorHandler { message -> throw ZError(message) }`).
- `throwZError0` (the binding `JniErrorHandler`) is unchanged — it now doubles
as the `onBindingError` of a fallible call.
Call sites: every fallible flat call gains `throwZError0` before its
`throwZError` (42 sites across Config/Session/KeyExpr/Liveliness/Publisher/
Querier/Query/Scout + one jvmTest), matching the wrapper's
`(…, onBindingError, onError)` order. Infallible calls (`throwZError0`) and
the binding-only `Encoding.newFromId { je -> … }` lambda are untouched.
Builds against the local composite zenoh-flat-jni (split-error-handler);
120 jvmTest tests pass, including the domain-error paths
(`configFailsWithIllFormatedYAMLTest`, `insertIllFormattedJson5ShouldFailTest`).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
milyin
force-pushed
the
split-error-handler
branch
2 times, most recently
from
July 21, 2026 11:19
7f41c39 to
f695913
Compare
The split error-handler regeneration (zenoh-flat-jni #10) plus the merged Kotlin ownership-marker fix (zenoh-flat-jni #11, 249fe9e on shared-parameters). CI pinned the pre-split 757cc6a, whose single-channel `ErrorHandler.run(je, message)` wrappers are incompatible with this branch's two-caller call sites; #11's marker is also required for the composite `cargo build` to regenerate at all (write_kotlin refuses a non-empty output root without it). Point CI at the merged commit so the composite build both matches the source and regenerates. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
milyin
force-pushed
the
split-error-handler
branch
from
July 21, 2026 11:30
f695913 to
45d8787
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Migrates the SDK to zenoh-flat-jni's split error-handler API (prebindgen #45, zenoh-flat-jni PR).
The generated flat wrappers now split the error callback into two channels: the binding
JniErrorHandler.run(je)(unchanged) and the typed domainErrorHandler.run(message)(jeremoved, called only on a domainErr). A fallible wrapper takes both —onBindingErrorthenonError.Changes
exceptions/JNIErrorHandlers.kt:throwZError→ the 1-arg domain handlerErrorHandler { message -> throw ZError(message) }.throwZError0(the bindingJniErrorHandler) is unchanged — it now doubles as theonBindingErrorof a fallible call.Call sites: every fallible flat call gains
throwZError0before itsthrowZError— 42 sites acrossConfig/Session/KeyExpr/Liveliness/Publisher/Querier/Query/Scout(+ one jvmTest), matching the wrapper's(…, onBindingError, onError)order. Infallible calls (barethrowZError0) and the binding-onlyEncoding.newFromId { je -> … }lambda are untouched.Validation
Builds against the local composite
zenoh-flat-jni(itssplit-error-handlerbranch); 120 jvmTest tests pass, including the domain-error paths (configFailsWithIllFormatedYAMLTest,insertIllFormattedJson5ShouldFailTest) that prove a zenoh error still surfaces asZError.Depends on the zenoh-flat-jni split-error-handler PR merging first.
🤖 Generated with Claude Code