fix exception handling in hostFileNative#399
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR enhances exception handling in hostFileNative, adding nested try-catch blocks to map specific C++ exceptions to distinct JNI error codes and reformats the native method signature.
- Wraps file hosting logic in an outer and inner
try-catchto handleUnknownFileType,UnsupportedFileType, genericstd::exception, and all other exceptions with different error codes. - Updates
engine_priorityinitialization formatting and adjusts logging calls. - Reformats method signatures for
hostFileNativeandlistenServerNative.
Comments suppressed due to low confidence (2)
app/src/main/cpp/CoreWrapper.cpp:427
- [nitpick] The new error code
-5forUnknownFileTypeshould be documented—add a comment or update JNI-side docs to explain this mapping.
} catch (const odr::UnknownFileType &e) {
app/src/main/cpp/CoreWrapper.cpp:427
- [nitpick] New exception branches (
UnknownFileType,UnsupportedFileType, etc.) lack unit or integration tests—add tests to verify each error code path.
} catch (const odr::UnknownFileType &e) {
hostFileNative
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.
No description provided.