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

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

commit 22b643693f6cdb69bfc47f95773cb9104531bd02
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 06ebcdda..69c3ff6f 100644
--- a/core/src/main/java/org/apache/ftpserver/util/EncryptUtils.java
+++ b/core/src/main/java/org/apache/ftpserver/util/EncryptUtils.java
@@ -66,7 +66,7 @@ public class EncryptUtils {
             return encrypt(source, MD5.MD5);
         } catch (NoSuchAlgorithmException ex) {
             // this should never happen
-            throw new RuntimeException(ex);
+            throw new IllegalArgumentException(ex);
         }
     }
 
@@ -78,7 +78,7 @@ public class EncryptUtils {
             return encrypt(source, "SHA");
         } catch (NoSuchAlgorithmException ex) {
             // this should never happen
-            throw new RuntimeException(ex);
+            throw new IllegalArgumentException(ex);
         }
     }
 

Reply via email to