You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an issue with a custom exception we use on android.
So to explain a bit i use sentry with (Nativescript)[https://nativescript.org/]
With Nativescript sometimes there a custom Exception thrown: (NativescriptException)[https://github.com/NativeScript/android/blob/main/test-app/runtime/src/main/java/com/tns/NativeScriptException.java].
That custom exception holds the Js stacktrace in addition to the java one.
So for sentry event to get the JS stacktrace i need to go through io.sentry.SentryOptions.BeforeSendCallback to try and get it.
There i get the throwable from the event using event.getThrowable.() and i get the exceptions type from event.getExceptions().get(0).getType().
The type correcly refers to our custom Exception class NativescriptException but the throwable is java.lang.RuntimeException (which is the parent class) and not com.tns.NativescriptException.
This is where the issue is. I need to get com.tns.NativescriptException to access getIncomingStackTrace() on it.
At first i though this could be because com.tns.NativescriptException does not implement Serializable so i did add it (not in the repo i linked) but it still did not work.
Is there a way for me to access my correct class com.tns.NativescriptException from the event?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have an issue with a custom exception we use on android.
So to explain a bit i use sentry with (Nativescript)[https://nativescript.org/]
With Nativescript sometimes there a custom Exception thrown: (NativescriptException)[https://github.com/NativeScript/android/blob/main/test-app/runtime/src/main/java/com/tns/NativeScriptException.java].
That custom exception holds the Js stacktrace in addition to the java one.
So for sentry event to get the JS stacktrace i need to go through
io.sentry.SentryOptions.BeforeSendCallback
to try and get it.There i get the throwable from the event using
event.getThrowable.()
and i get the exceptions type fromevent.getExceptions().get(0).getType()
.The type correcly refers to our custom Exception class
NativescriptException
but the throwable isjava.lang.RuntimeException
(which is the parent class) and notcom.tns.NativescriptException
.This is where the issue is. I need to get
com.tns.NativescriptException
to accessgetIncomingStackTrace()
on it.At first i though this could be because
com.tns.NativescriptException
does not implementSerializable
so i did add it (not in the repo i linked) but it still did not work.Is there a way for me to access my correct class
com.tns.NativescriptException
from the event?Beta Was this translation helpful? Give feedback.
All reactions