Print stacktraces on any errors.

This commit is contained in:
FireMasterK 2021-07-21 18:07:43 +05:30
parent 3d030b6968
commit cf9d1cd8cf
No known key found for this signature in database
GPG key ID: 49451E4482CC5BCD
2 changed files with 11 additions and 10 deletions

View file

@ -1,6 +1,5 @@
package me.kavin.piped;
import java.io.IOException;
import java.util.Collections;
import java.util.List;
import java.util.Timer;
@ -49,7 +48,7 @@ public class Main {
Session sess = DatabaseSessionFactory.createSession();
try {
ResponseHelper.subscribePubSub(channelId, sess);
} catch (IOException | InterruptedException e) {
} catch (Exception e) {
e.printStackTrace();
}
sess.close();

View file

@ -609,13 +609,15 @@ public class ResponseHelper {
sess.save(channel);
sess.beginTransaction().commit();
Multithreading.runAsync(() -> {
try {
Session sessSub = DatabaseSessionFactory.createSession();
subscribePubSub(channelId, sessSub);
sessSub.close();
} catch (IOException | InterruptedException e) {
ExceptionUtils.rethrow(e);
} catch (Exception e) {
e.printStackTrace();
}
});
for (StreamInfoItem item : info.getRelatedItems()) {
long time = item.getUploadDate() != null
@ -822,7 +824,7 @@ public class ResponseHelper {
Session sessSub = DatabaseSessionFactory.createSession();
subscribePubSub(channelId, sessSub);
sessSub.close();
} catch (IOException | InterruptedException e) {
} catch (Exception e) {
e.printStackTrace();
}
});