mirror of https://github.com/sbt/sbt.git
WorkerMain: exit quietly on invalid JSON-RPC input (no stack trace)
When input lacks 'jsonrpc' field (e.g. {}), call System.exit(1) instead
of throwing IllegalArgumentException. Avoids noisy stack traces in
CI from WorkerExchangeTest's intentional bad-input tests.
This commit is contained in:
parent
4dfe68a681
commit
3de8704bd3
|
|
@ -115,7 +115,8 @@ public final class WorkerMain {
|
|||
JsonElement elem = JsonParser.parseString(json);
|
||||
JsonObject o = elem.getAsJsonObject();
|
||||
if (!o.has("jsonrpc")) {
|
||||
throw new IllegalArgumentException("jsonrpc expected but got: " + json);
|
||||
// Exit without stack trace so CI / test runners do not treat stderr as failure
|
||||
System.exit(1);
|
||||
}
|
||||
Gson g = WorkerMain.mkGson();
|
||||
long id = o.getAsJsonPrimitive("id").getAsLong();
|
||||
|
|
|
|||
Loading…
Reference in New Issue