Skip to content

Commit 17f25bc

Browse files
committed
[grid] Improve json body of error message sent from NewSessionQueue
1 parent 1902fb8 commit 17f25bc

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

java/src/org/openqa/selenium/grid/sessionqueue/local/LocalNewSessionQueue.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import static org.openqa.selenium.concurrent.ExecutorServices.shutdownGracefully;
66

77
import com.google.common.annotations.VisibleForTesting;
8+
import com.google.common.collect.ImmutableMap;
89

910
import org.openqa.selenium.Capabilities;
1011
import org.openqa.selenium.SessionNotCreatedException;
@@ -221,7 +222,10 @@ public HttpResponse addToQueue(SessionRequest request) {
221222
res.setContent(Contents.bytes(result.right().getDownstreamEncodedResponse()));
222223
} else {
223224
res.setStatus(HTTP_INTERNAL_ERROR)
224-
.setContent(Contents.asJson(Collections.singletonMap("value", result.left())));
225+
.setContent(Contents.asJson(ImmutableMap.of(
226+
"value", ImmutableMap.of("error", "session not created",
227+
"message", result.left().getMessage(),
228+
"stacktrace", result.left().getStackTrace()))));
225229
}
226230

227231
return res;

0 commit comments

Comments
 (0)