You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2022/07/01 15:55:50 UTC

[commons-crypto] branch master updated: Ensure error is propagated

This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-crypto.git


The following commit(s) were added to refs/heads/master by this push:
     new 4c1fc8e  Ensure error is propagated
4c1fc8e is described below

commit 4c1fc8eb29addacbde09b9c53182b1a4e3629ef8
Author: Sebb <se...@apache.org>
AuthorDate: Fri Jul 1 16:55:41 2022 +0100

    Ensure error is propagated
---
 src/main/java/org/apache/commons/crypto/jna/OpenSslJna.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/main/java/org/apache/commons/crypto/jna/OpenSslJna.java b/src/main/java/org/apache/commons/crypto/jna/OpenSslJna.java
index 41d3299..9a26034 100644
--- a/src/main/java/org/apache/commons/crypto/jna/OpenSslJna.java
+++ b/src/main/java/org/apache/commons/crypto/jna/OpenSslJna.java
@@ -78,13 +78,13 @@ public final class OpenSslJna {
         return OpenSslNativeJna.INIT_OK;
     }
 
-    public static void main(final String[] args) {
+    public static void main(final String[] args) throws Throwable {
         info("isEnabled(): %s", isEnabled());
         final Throwable initialisationError = initialisationError();
         info("initialisationError(): %s", initialisationError);
         if (initialisationError != null) {
             System.err.flush(); // helpful for stack traces to not mix in other output.
-            initialisationError.printStackTrace();
+            throw initialisationError; // propagate to make error obvious
         }
     }