1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package io.netty5.handler.codec.http.websocketx;
17
18 import io.netty5.handler.codec.http.DefaultHttpRequest;
19 import io.netty5.handler.codec.http.FullHttpRequest;
20 import io.netty5.handler.codec.http.HttpRequest;
21 import io.netty5.util.ReferenceCounted;
22
23
24
25
26
27
28
29 public final class WebSocketServerHandshakeException extends WebSocketHandshakeException {
30
31 private static final long serialVersionUID = 1L;
32
33 private final HttpRequest request;
34
35 public WebSocketServerHandshakeException(String message) {
36 this(message, null);
37 }
38
39 public WebSocketServerHandshakeException(String message, HttpRequest httpRequest) {
40 super(message);
41 if (httpRequest != null) {
42 request = new DefaultHttpRequest(httpRequest.protocolVersion(), httpRequest.method(),
43 httpRequest.uri(), httpRequest.headers());
44 } else {
45 request = null;
46 }
47 }
48
49
50
51
52 public HttpRequest request() {
53 return request;
54 }
55 }