mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-28 18:10:38 +00:00
Improve error message and log output for failed jsonrpc commands
This commit is contained in:
parent
485c4fd467
commit
7cc0ef1c70
1 changed files with 7 additions and 5 deletions
|
@ -229,15 +229,17 @@ public class SignalJsonRpcCommandHandler {
|
|||
case RateLimitErrorException e -> throw new JsonRpcException(new JsonRpcResponse.Error(RATELIMIT_ERROR,
|
||||
e.getMessage(),
|
||||
getErrorDataNode(objectMapper, result)));
|
||||
case UnexpectedErrorException e ->
|
||||
throw new JsonRpcException(new JsonRpcResponse.Error(JsonRpcResponse.Error.INTERNAL_ERROR,
|
||||
e.getMessage(),
|
||||
getErrorDataNode(objectMapper, result)));
|
||||
case UnexpectedErrorException e -> {
|
||||
logger.error("Command execution failed with unexpected error", e);
|
||||
throw new JsonRpcException(new JsonRpcResponse.Error(JsonRpcResponse.Error.INTERNAL_ERROR,
|
||||
e.getMessage() + " (" + e.getClass().getSimpleName() + ")",
|
||||
getErrorDataNode(objectMapper, result)));
|
||||
}
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
logger.error("Command execution failed", e);
|
||||
throw new JsonRpcException(new JsonRpcResponse.Error(JsonRpcResponse.Error.INTERNAL_ERROR,
|
||||
e.getMessage(),
|
||||
e.getMessage() + " (" + e.getClass().getSimpleName() + ")",
|
||||
getErrorDataNode(objectMapper, result)));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue