Fix "cast" exception. Handle result from external browser as object.
This commit is contained in:
parent
babb522f91
commit
3f75e03766
|
@ -182,8 +182,8 @@ public class ExternalBrowser implements AutoCloseable {
|
||||||
if (future != null) {
|
if (future != null) {
|
||||||
responseFutures.remove(msgid);
|
responseFutures.remove(msgid);
|
||||||
if (json.has("result")) {
|
if (json.has("result")) {
|
||||||
LOG.debug("Future {} done", msgid);
|
LOG.debug("Future {} done. Result: {}", msgid, json.get("result"));
|
||||||
future.complete(json.getString("result"));
|
future.complete(json.get("result"));
|
||||||
} else if (json.has("error")) {
|
} else if (json.has("error")) {
|
||||||
LOG.debug("Future {} failed", msgid);
|
LOG.debug("Future {} failed", msgid);
|
||||||
future.completeExceptionally(new Exception(json.getJSONObject("error").toString()));
|
future.completeExceptionally(new Exception(json.getJSONObject("error").toString()));
|
||||||
|
|
Loading…
Reference in New Issue