1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package io.netty.resolver.dns;
18
19 import io.netty.handler.codec.dns.DnsResponseCode;
20 import io.netty.util.internal.ThrowableUtil;
21
22 import java.net.UnknownHostException;
23
24
25
26
27
28 public final class DnsErrorCauseException extends RuntimeException {
29
30 private static final long serialVersionUID = 7485145036717494533L;
31
32 private final DnsResponseCode code;
33
34 private DnsErrorCauseException(String message, DnsResponseCode code, boolean shared) {
35 super(message, null, false, true);
36 this.code = code;
37 assert shared;
38 }
39
40
41
42 @Override
43 public Throwable fillInStackTrace() {
44 return this;
45 }
46
47
48
49
50
51
52 public DnsResponseCode getCode() {
53 return code;
54 }
55
56 static DnsErrorCauseException newStatic(String message, DnsResponseCode code, Class<?> clazz, String method) {
57 final DnsErrorCauseException exception = new DnsErrorCauseException(message, code, true);
58 return ThrowableUtil.unknownStackTrace(exception, clazz, method);
59 }
60 }