File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
java/src/org/openqa/selenium/grid/web Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 17
17
18
18
package org .openqa .selenium .grid .web ;
19
19
20
+ import org .openqa .selenium .UnsupportedCommandException ;
20
21
import org .openqa .selenium .internal .Require ;
21
22
import org .openqa .selenium .remote .http .ClientConfig ;
22
23
import org .openqa .selenium .remote .http .HttpClient ;
28
29
import java .net .URI ;
29
30
import java .net .URL ;
30
31
31
- import static org .openqa .selenium .remote .http .Contents .utf8String ;
32
+ import static org .openqa .selenium .remote .http .Contents .asJson ;
33
+
34
+ import com .google .common .collect .ImmutableMap ;
32
35
33
36
public class RoutableHttpClientFactory implements HttpClient .Factory {
34
37
@@ -59,7 +62,10 @@ public HttpResponse execute(HttpRequest request) throws UncheckedIOException {
59
62
60
63
if (!handler .test (request )) {
61
64
response .setStatus (404 );
62
- response .setContent (utf8String ("Unable to route " + request ));
65
+ response .setContent (asJson (ImmutableMap .of (
66
+ "value" , request .getUri (),
67
+ "message" , "Unable to route " + request ,
68
+ "error" , UnsupportedCommandException .class .getName ())));
63
69
return response ;
64
70
}
65
71
You can’t perform that action at this time.
0 commit comments