mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 10:30:38 +00:00
Show better error message when receiving an empty JSON RPC line
Fixes #1715
This commit is contained in:
parent
cf5c943127
commit
e1f4dae5c2
1 changed files with 7 additions and 0 deletions
|
@ -151,6 +151,13 @@ public class JsonRpcReader {
|
||||||
}
|
}
|
||||||
|
|
||||||
private JsonRpcMessage parseJsonRpcMessage(final String input) {
|
private JsonRpcMessage parseJsonRpcMessage(final String input) {
|
||||||
|
if (input.trim().isEmpty()) {
|
||||||
|
jsonRpcSender.sendResponse(JsonRpcResponse.forError(new JsonRpcResponse.Error(JsonRpcResponse.Error.PARSE_ERROR,
|
||||||
|
"Empty input line",
|
||||||
|
null), null));
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
final JsonNode jsonNode;
|
final JsonNode jsonNode;
|
||||||
try {
|
try {
|
||||||
jsonNode = objectMapper.readTree(input);
|
jsonNode = objectMapper.readTree(input);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue