Attempt to log import errors. (#312)

This commit is contained in:
Kavin 2022-07-08 10:41:49 +01:00 committed by GitHub
parent c85cbf6034
commit c7a0535039
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 23 deletions

View file

@ -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<String, List<String>> get(URI uri, Map<String, List<String>> requestHeaders) throws IOException {
// TODO Auto-generated method stub
return null;
}
@Override
public void put(URI uri, Map<String, List<String>> responseHeaders) throws IOException {
// TODO Auto-generated method stub
}
}

View file

@ -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(() -> {