Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

BeforeSendCallback with custom Exception #3231

Unanswered
farfromrefug asked this question in Q&A
Discussion options

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?

You must be logged in to vote

Replies: 0 comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant

AltStyle によって変換されたページ (->オリジナル) /