When the recover() method is called with insufficient number of shares provided (below the threshold), it should return null/falsy value. However, the recover() method currently does not return a reasonable falsy value that can be captured by the application. It also does not throw an appropriate Java Exception. Instead, the rust library crashes.
I get the below output after doing gradle clean build and gradle run:
> Task :run FAILED
thread '<unnamed>' panicked at <...>/cryptography/src/secret_sharing/utils.rs:45:34:
called `Result::unwrap()` on an `Err` value: Error
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
fatal runtime error: failed to initiate panic, error 5
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':run'.
> Process 'command '/opt/homebrew/Cellar/openjdk/21.0.1/libexec/openjdk.jdk/Contents/Home/bin/java'' finished with non-zero exit value 134
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.
Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
For more on this, please refer to https://docs.gradle.org/8.5/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.
BUILD FAILED in 454ms
6 actionable tasks: 1 executed, 5 up-to-date
When the
recover()
method is called with insufficient number of shares provided (below the threshold), it should return null/falsy value. However, therecover()
method currently does not return a reasonable falsy value that can be captured by the application. It also does not throw an appropriate Java Exception. Instead, the rust library crashes.When run with the following test code:
I get the below output after doing
gradle clean build
andgradle run
: