From 0c43e416f57c790e6eee1048ccd47b31bdac2c58 Mon Sep 17 00:00:00 2001 From: TudbuT Date: Wed, 6 Jul 2022 13:21:31 +0200 Subject: [PATCH] fix bugs --- src/de/tudbut/tryumph/server/BrowserContext.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/de/tudbut/tryumph/server/BrowserContext.java b/src/de/tudbut/tryumph/server/BrowserContext.java index 6e091bb..88bad83 100644 --- a/src/de/tudbut/tryumph/server/BrowserContext.java +++ b/src/de/tudbut/tryumph/server/BrowserContext.java @@ -34,11 +34,7 @@ public class BrowserContext { private BrowserContext(String cookie, IRequestCatcher requestCatcher) { this.requestCatcher = requestCatcher; - try { - data = AsyncJSON.read(cookie).err(e -> {throw new RuntimeException(e);}).ok().await(); - } catch (Exception e) { - data = new TCN("JSON"); - } + AsyncJSON.read(cookie).then(x -> data = x).err(e -> data = new TCN("json")).ok().await(); } public static Task create(IRequestCatcher requestCatcher) {