-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Notify handled android java exceptions #223
Comments
Hey @troy-lamerton |
Hey @johnkiely1, I would like to know if the Unity notifier only reports exceptions on Unity scenes. It the game has portions of code that are native are exceptions reported? |
Hey @interpegasus, Unhandled native exceptions are captured when using the Unity notifier. This applies to Android iOS and MacOs. This would occur by default once you have integrated Bugsnag into your application. https://docs.bugsnag.com/platforms/unity/#reporting-unhandled-errors The Android/iOS/macOs notifiers are used under the hood by the Unity notifier to do this. |
We have a solution internally and are testing it at the moment. So this is lower priority for us now. Solution goes like this:
Code snippet for steps 1 and 2: @AnyThread
@JvmStatic
fun reportPluginError(ex: Throwable) {
// getStackTraceString: exception class, message and stacktrace
val readableException = Log.getStackTraceString(ex).trim().replace("\t", " ")
UnityPlayer.UnitySendMessage("NativePluginListener", "ReportNativeWarning", readableException)
} Would be good to keep this issue open to track implementing the feature in the Bugsnag source code. |
Description
In our Unity game, we have a lot of android plugins that need to report exceptions.
Since we use the Unity SDK, there is no obvious way to report these java/kotlin exceptions.
Describe the solution you'd like
Any way to send a java/kotlin exception to the bugsnag dashboard.
A simple api could be:
public void Notify(AndroidJavaObject jvmException)
Describe alternatives you've considered
Calling Bugsnag.Notify with stacktrace string
Result: I think the message is not retraced? (class names will show a.b.c.d)
Calling the bugsnag android SDK via reflection:
Result: This does work.. but any native crash that happens after this (e.g. SIGTRAP) is not reported to bugsnag.
The text was updated successfully, but these errors were encountered: