-
-
Notifications
You must be signed in to change notification settings - Fork 503
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
JRuby: unable to capture Java exceptions #2043
Comments
thanks @richard-kramer we should definitely support this if possible. PRs are always welcome, otherwise I'll take a look at the possibilities when I have some time. |
richard-kramer
added a commit
to richard-kramer/sentry-ruby
that referenced
this issue
May 17, 2023
richard-kramer
added a commit
to richard-kramer/sentry-ruby
that referenced
this issue
May 17, 2023
I created #2044 as a simple fix. Hopefully, this is already enough. |
richard-kramer
added a commit
to richard-kramer/sentry-ruby
that referenced
this issue
Jun 7, 2023
richard-kramer
added a commit
to richard-kramer/sentry-ruby
that referenced
this issue
Jun 7, 2023
richard-kramer
added a commit
to richard-kramer/sentry-ruby
that referenced
this issue
Jun 7, 2023
st0012
pushed a commit
that referenced
this issue
Jun 7, 2023
@richard-kramer I think this can be closed? (Meant to just click comment 🤦♂️ ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Issue Description
Using sentry in JRuby, it is not possible to directly capture exceptions, which originated in java, as they do not inherit from
Exception
.Currently, the only ways to log these exceptions, would be to wrap the Java exception in a custom Ruby exception an pass that to Sentry or to patch the
is_a?
method on the Java exception to respond withtrue
ifException
is passed. Both solutions don't really seem that clean.I also submitted an issue over at JRuby, but it seems that behavior is intended. Java exceptions inherit from
Java::JavaLang::Error
andJava::JavaLang::Throwable
, so maybe one of those (probablyJava::JavaLang::Throwable
) could be added to the type check in JRuby?Reproduction Steps
The following snippet enters the
rescue
block, but the exception cannot be captured:Expected Behavior
The exception can be captured by Sentry as it should respond to the expected interface of an exception.
Actual Behavior
Capturing the exception results in an error thrown by sentry because of this type check.
Ruby Version
jruby-9.2.20.0
SDK Version
5.5.0
Integration and Its Version
sentry-rails (5.5.0)
Sentry Config
No response
The text was updated successfully, but these errors were encountered: