diff --git a/src/main/java/me/kavin/piped/utils/CookieHandler.java b/src/main/java/me/kavin/piped/utils/CookieHandler.java deleted file mode 100644 index 2153f12..0000000 --- a/src/main/java/me/kavin/piped/utils/CookieHandler.java +++ /dev/null @@ -1,21 +0,0 @@ -package me.kavin.piped.utils; - -import java.io.IOException; -import java.net.URI; -import java.util.List; -import java.util.Map; - -public class CookieHandler extends java.net.CookieHandler { - - @Override - public Map> get(URI uri, Map> requestHeaders) throws IOException { - // TODO Auto-generated method stub - return null; - } - - @Override - public void put(URI uri, Map> responseHeaders) throws IOException { - // TODO Auto-generated method stub - - } -} diff --git a/src/main/java/me/kavin/piped/utils/ResponseHelper.java b/src/main/java/me/kavin/piped/utils/ResponseHelper.java index 9f2220d..bbbba33 100644 --- a/src/main/java/me/kavin/piped/utils/ResponseHelper.java +++ b/src/main/java/me/kavin/piped/utils/ResponseHelper.java @@ -982,6 +982,8 @@ public class ResponseHelper { s.update(user); tr.commit(); } + } catch (Exception e) { + ExceptionHandler.handle(e); } }); @@ -996,6 +998,8 @@ public class ResponseHelper { .findFirst().isEmpty() ) .forEach(channelId -> Multithreading.runAsyncLimited(() -> saveChannel(channelId))); + } catch (Exception e) { + ExceptionHandler.handle(e); } }); @@ -1417,10 +1421,12 @@ public class ResponseHelper { var channel = new me.kavin.piped.utils.obj.db.Channel(channelId, info.getName(), info.getAvatarUrl(), info.isVerified()); - try (Session s = DatabaseSessionFactory.createSession()) { + try (StatelessSession s = DatabaseSessionFactory.createStatelessSession()) { var tr = s.beginTransaction(); - s.persist(channel); + s.insert(channel); tr.commit(); + } catch (Exception e) { + ExceptionHandler.handle(e); } Multithreading.runAsync(() -> {