Comments (9)
@EliseChouleur assuming you're asking me, it may take me some time, but I'll give the PR a shot on Android and desktop and reply with the results!
from robusta.
I checked the source code for Error
in the standard lib, and yeah, description()
is indeed hardcoded to that string.
From error.rs
:
from robusta.
It's been buried for a while: rust-lang/rfcs#2230
from robusta.
Thank you for the issue! I'll try to fix it ASAP as it seems it impacts already other users #29
from robusta.
I guess a recent version of Rust just shot that function off of std, since it's been deprecated for long enough :p
But yeah, using Display
will make errors actually print something useful to make debugging easier, since description
was made useless for quite some time now with the hardcoded message.
P.S.: Thanks a lot for this incredible crate! It makes JNI interop a breeze, alongside cargo-ndk which makes building for Android (with NDK) an easy one-line command!
from robusta.
Hi! Any updates on this?
from robusta.
Hi !
Could you check with darling update ? #31
from robusta.
Hi again! Sorry for my delay, but I can confirm that #31 fixes the issue on Android.
Now instead of the confusing:
java.lang.RuntimeException: JNI call error!. Cause: description() is deprecated; use Display
it correctly reports the error message
java.lang.RuntimeException: JNI call error!. Cause: Java exception was thrown
So updating darling is a valid fix. I don't expect there to be any difference on the desktop (JVM) side, since this bug is purely from the Rust side.
from robusta.
This makes me wonder, however, that it should be possible to pass a custom message to JniError::JavaException type, so that error messages are generally more helpful.
For example in this case, if I want information about the cause of the error, I'd have to log it right before returning the JniError::JavaException to keep those details.
However this should be its own issue.
from robusta.
Related Issues (20)
- Support for Option<T>? HOT 8
- Support for primitive arrays in combination with Signature HOT 1
- Invalid Return Signature on Call Java Void function from Rust HOT 2
- [Features request] Mark the type of Error in rust
- Illegal hardware instruction java - when calling Rust code from Java HOT 1
- Is arm64 architecture (M1Max MacBook) supported? HOT 1
- Throw an exception specific to the returned error instance
- `pub` keyword in "jni" functions causing weird compiler error about unrelated code. HOT 2
- No way to return an error with arbitrary message HOT 2
- [Features request] Rust JNI vs Java benchmark example
- Dependency version update HOT 2
- Windows support HOT 1
- TryFromJavaValue is not safe
- Any way to make IDE aware of `#[bridge]` struct? HOT 1
- Generics support HOT 1
- Issue with mapping Java class fields of type `byte[]` to a `Field` with type `Box<[u8]>` HOT 1
- Overloaded methods support
- Catch panics
- Java inheritance HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from robusta.