From 240e049e46f630fef5b1317e2ceb66604497a81f Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Thu, 19 Mar 2020 13:03:08 -0600 Subject: [PATCH] InetEndpoint: return proper parser exception Wrapping this in something foreign doesn't make sense. Reported-by: Luis Ressel Signed-off-by: Jason A. Donenfeld --- tunnel/src/main/java/com/wireguard/config/InetEndpoint.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tunnel/src/main/java/com/wireguard/config/InetEndpoint.java b/tunnel/src/main/java/com/wireguard/config/InetEndpoint.java index 0120de0e..6eff4a1b 100644 --- a/tunnel/src/main/java/com/wireguard/config/InetEndpoint.java +++ b/tunnel/src/main/java/com/wireguard/config/InetEndpoint.java @@ -51,7 +51,7 @@ public final class InetEndpoint { try { uri = new URI("wg://" + endpoint); } catch (final URISyntaxException e) { - throw new IllegalArgumentException(e); + throw new ParseException(InetEndpoint.class, endpoint, e); } if (uri.getPort() < 0 || uri.getPort() > 65535) throw new ParseException(InetEndpoint.class, endpoint, "Missing/invalid port number");