[grid] Reverting change to internalErrorResponse
package org.openqa.selenium.grid.sessionqueue;
+import static java.net.HttpURLConnection.HTTP_INTERNAL_ERROR;
+import static java.util.Collections.singletonMap;
+import static org.openqa.selenium.remote.http.Contents.asJson;
+import static org.openqa.selenium.remote.http.Contents.bytes;
+
import org.openqa.selenium.events.EventBus;
import org.openqa.selenium.grid.data.NewSessionErrorResponse;
import org.openqa.selenium.grid.data.NewSessionRejectedEvent;
import java.util.logging.Level;
import java.util.logging.Logger;
-import static java.net.HttpURLConnection.HTTP_INTERNAL_ERROR;
-import static java.util.Collections.singletonMap;
-import static org.openqa.selenium.remote.http.Contents.asJson;
-import static org.openqa.selenium.remote.http.Contents.bytes;
-
public class GetNewSessionResponse {
private static final Logger LOG = Logger.getLogger(GetNewSessionResponse.class.getName());
+ private static final Map<RequestId, NewSessionRequest> knownRequests = new ConcurrentHashMap<>();
private final EventBus bus;
private final Tracer tracer;
private final NewSessionQueue sessionRequests;
- private static final Map<RequestId, NewSessionRequest> knownRequests = new ConcurrentHashMap<>();
private final ReadWriteLock lock = new ReentrantReadWriteLock(true);
public GetNewSessionResponse(Tracer tracer, EventBus bus,
@@ -143,7 +143,7 @@ public HttpResponse add(HttpRequest request) {
private HttpResponse internalErrorResponse(String message) {
return new HttpResponse()
.setStatus(HTTP_INTERNAL_ERROR)
- .setContent(asJson(singletonMap("value", singletonMap("message", message))));
+ .setContent(asJson(singletonMap("message", message)));
}
private void removeRequest(RequestId id) {
