当在弹幕推送流中接收到不可解析的 JSON 时, 输出一个字符串而不是比特数组

This commit is contained in:
czp 2018-03-13 22:30:20 +08:00
parent 26fe4e397c
commit 5cc07cfcea

View File

@ -72,7 +72,7 @@ public class LiveClientHandler extends SimpleChannelInboundHandler<Package> {
jsonObject = JSON_PARSER.parse(new InputStreamReader(new ByteArrayInputStream(msg.getContent())))
.getAsJsonObject();
} catch (JsonSyntaxException | IllegalStateException e) {
LOGGER.error("Receive invalid json: \n{}", msg.getContent());
LOGGER.error("Receive invalid json: \n{}", new String(msg.getContent()));
e.printStackTrace();
break;
}