You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2023/06/23 20:27:08 UTC

[commons-vfs] 01/15: [impl] Throw a specialized RuntimeException instead of RuntimeException

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/commons-vfs.git

commit 7ab04ec2566df73cb4a58c933a161d692fda6eae
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Fri Jun 23 16:24:02 2023 -0400

    [impl] Throw a specialized RuntimeException instead of
    RuntimeException
---
 .../main/java/org/apache/commons/vfs2/impl/URLStreamHandlerProxy.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/impl/URLStreamHandlerProxy.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/impl/URLStreamHandlerProxy.java
index acde392c..a0cef7d8 100644
--- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/impl/URLStreamHandlerProxy.java
+++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/impl/URLStreamHandlerProxy.java
@@ -39,9 +39,9 @@ final class URLStreamHandlerProxy extends URLStreamHandler {
             setURL(u, url.getProtocol(), url.getHost(), url.getPort(), url.getAuthority(), url.getUserInfo(),
                     url.getFile(), url.getQuery(), url.getRef());
         } catch (final MalformedURLException mue) {
-            // We rethrow this as a simple runtime exception.
+            // We rethrow this as a runtime exception.
             // It is rethrown in URL as a MalformedURLException anyway.
-            throw new RuntimeException(mue.getMessage());
+            throw new IllegalArgumentException(mue.getMessage());
         }
     }
 }