Code Monkey home page Code Monkey logo

Comments (9)

Skaldebane avatar Skaldebane commented on May 24, 2024 1

@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.

Skaldebane avatar Skaldebane commented on May 24, 2024

I checked the source code for Error in the standard lib, and yeah, description() is indeed hardcoded to that string.

From error.rs:

image

from robusta.

Skaldebane avatar Skaldebane commented on May 24, 2024

It's been buried for a while: rust-lang/rfcs#2230

from robusta.

giovanniberti avatar giovanniberti commented on May 24, 2024

Thank you for the issue! I'll try to fix it ASAP as it seems it impacts already other users #29

from robusta.

Skaldebane avatar Skaldebane commented on May 24, 2024

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.

Skaldebane avatar Skaldebane commented on May 24, 2024

Hi! Any updates on this?

from robusta.

EliseChouleur avatar EliseChouleur commented on May 24, 2024

Hi !
Could you check with darling update ? #31

from robusta.

Skaldebane avatar Skaldebane commented on May 24, 2024

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.

Skaldebane avatar Skaldebane commented on May 24, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.