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

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mina-ftpserver.git


The following commit(s) were added to refs/heads/master by this push:
     new 30550ca5 Throw IllegalArgumentException instead of RuntimeException on 
bad input to EncryptUtils
30550ca5 is described below

commit 30550ca52a4e7448d669b2567171f9ddfa834e2f
Author: Gary Gregory <garydgreg...@gmail.com>
AuthorDate: Wed Jul 5 08:11:05 2023 -0400

    Throw IllegalArgumentException instead of RuntimeException on bad input
    to EncryptUtils
---
 core/src/main/java/org/apache/ftpserver/util/EncryptUtils.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/core/src/main/java/org/apache/ftpserver/util/EncryptUtils.java 
b/core/src/main/java/org/apache/ftpserver/util/EncryptUtils.java
index 77077262..072864d5 100644
--- a/core/src/main/java/org/apache/ftpserver/util/EncryptUtils.java
+++ b/core/src/main/java/org/apache/ftpserver/util/EncryptUtils.java
@@ -64,7 +64,7 @@ public class EncryptUtils {
             result = encrypt(source, "MD5");
         } catch (NoSuchAlgorithmException ex) {
             // this should never happen
-            throw new RuntimeException(ex);
+            throw new IllegalArgumentException(ex);
         }
         return result;
     }
@@ -82,7 +82,7 @@ public class EncryptUtils {
             result = encrypt(source, "SHA");
         } catch (NoSuchAlgorithmException ex) {
             // this should never happen
-            throw new RuntimeException(ex);
+            throw new IllegalArgumentException(ex);
         }
         return result;
     }

Reply via email to