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 1717
1818package org .openqa .selenium .grid .web ;
1919
20+ import org .openqa .selenium .UnsupportedCommandException ;
2021import org .openqa .selenium .internal .Require ;
2122import org .openqa .selenium .remote .http .ClientConfig ;
2223import org .openqa .selenium .remote .http .HttpClient ;
2829import java .net .URI ;
2930import java .net .URL ;
3031
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 ;
3235
3336public class RoutableHttpClientFactory implements HttpClient .Factory {
3437
@@ -59,7 +62,10 @@ public HttpResponse execute(HttpRequest request) throws UncheckedIOException {
5962
6063 if (!handler .test (request )) {
6164 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 ())));
6369 return response ;
6470 }
6571
You can’t perform that action at this time.
0 commit comments