feat(ndk): expose init return code#1430
Conversation
|
@markushi, I think we discussed this some time ago, but I can't remember whether return code or Exception was the choice back then. |
|
Just as info, I made it so that an exception will be thrown by the ndk integration in |
|
But yeah, interestingly i think these sentry-native/ndk/lib/src/main/jni/sentry.c Lines 299 to 302 in 9895a5c With this change its also sub-optimal, since the developer might turn on sentry-native/src/sentry_core.c Lines 180 to 184 in 9895a5c ? // Edit: okay i don't know if |
|
I think that was the main reason exceptions were raised back then: it allowed clients to differentiate between a native |
|
@sentry review |
|
@hannojg thanks for opening this up! This is definitely an area of improvement and I think using a return code is the way to go right now. It would also allow some flexibility, e.g. returning some positive integer |
markushi
left a comment
There was a problem hiding this comment.
Thanks again you for contributing, much appreciated! I left a comment on how far the return code should be propagated up. If something is unclear, just let me know.
|
Just my 2c here:
|
|
@hannojg it's been a while, do you want to address the PR feedback or should I take care of that? |
Hey, thanks for asking! Would love to contribute but realistically I won't have time for it :( would appreciate it very much if you guys can take care, thanks 🙏 |
supervacuus
left a comment
There was a problem hiding this comment.
LGTM! But can we hold off on merging this so we can add it to the also-breaking inproc changes from #1446 for a single breaking-bump release (I hope we can do both this week)?
Sure, sounds good to me! I'll keep my "requested change" reviewer status for now then, so it doesn't get merged accidentally. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1430 +/- ##
===========================================
- Coverage 84.66% 66.46% -18.20%
===========================================
Files 58 64 +6
Lines 7960 11187 +3227
Branches 1556 1897 +341
===========================================
+ Hits 6739 7435 +696
- Misses 1058 3524 +2466
- Partials 163 228 +65 🚀 New features to boost your workflow:
|
Return int from SentryNdk.init reflecting sentry_init result.
This can then be used by sentry-java/android to double check if the Ndk integration could be initialized successfully (which currently isn't happening, we just call the native method and assume it went successful).
Upstream PR in
getsentry/sentry-javafor android ndk: