Skip to content

Commit

Permalink
Catch UncheckedExecutionException in cache lookups
Browse files Browse the repository at this point in the history
That exception happens on bad dns names
  • Loading branch information
nabam authored and Lev Popov committed Sep 13, 2016
1 parent 296dbab commit fe9512d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/java/com/spotify/dns/CachingLookupFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import com.google.common.base.Preconditions;
import com.google.common.cache.Cache;
import com.google.common.cache.CacheBuilder;
import com.google.common.util.concurrent.UncheckedExecutionException;

import org.xbill.DNS.Lookup;

Expand Down Expand Up @@ -58,6 +59,8 @@ public Lookup call() {
);
} catch (ExecutionException e) {
throw new DnsException(e);
} catch (UncheckedExecutionException e) {
throw new DnsException(e);
}
}
}

0 comments on commit fe9512d

Please sign in to comment.