Fix "cast" exception. Handle result from external browser as object.

This commit is contained in:
0xb00bface 2021-09-09 16:57:14 +02:00
parent babb522f91
commit 3f75e03766
1 changed files with 2 additions and 2 deletions

View File

@ -182,8 +182,8 @@ public class ExternalBrowser implements AutoCloseable {
if (future != null) {
responseFutures.remove(msgid);
if (json.has("result")) {
LOG.debug("Future {} done", msgid);
future.complete(json.getString("result"));
LOG.debug("Future {} done. Result: {}", msgid, json.get("result"));
future.complete(json.get("result"));
} else if (json.has("error")) {
LOG.debug("Future {} failed", msgid);
future.completeExceptionally(new Exception(json.getJSONObject("error").toString()));