Skip to content

Commit 7d147fd

Browse files
committed
Set exception cause
1 parent c409e85 commit 7d147fd

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/com/namelessmc/NamelessAPI/Request.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ public Request(URL baseUrl, Action action, String... parameters) {
6262
url = new URL(action.toString());
6363
}
6464
} catch (MalformedURLException e) {
65-
throw new IllegalArgumentException("URL is malformed (" + e.getMessage() + ")");
65+
IllegalArgumentException ex = new IllegalArgumentException("URL is malformed (" + e.getMessage() + ")");
66+
ex.initCause(e);
67+
throw ex;
6668
}
6769
}
6870

0 commit comments

Comments
 (0)