Improved solution to 1.4-compatible IllegalArgumentException with "cause" exception (as suggested on dev list).

This commit is contained in:
Luke Taylor 2006-01-27 18:53:37 +00:00
parent fbe5957c23
commit 9062b4c352
1 changed files with 3 additions and 2 deletions

View File

@ -60,8 +60,9 @@ public class LdapUtils {
try { try {
return new URI(url); return new URI(url);
} catch (URISyntaxException e) { } catch (URISyntaxException e) {
logger.error("Failed to parse url " + url, e); IllegalArgumentException iae = new IllegalArgumentException("Unable to parse url: " + url);
throw new IllegalArgumentException("Unable to parse url: " + url); iae.initCause(e);
throw iae;
} }
} }