mirror of
https://github.com/TeamPiped/Piped-Backend.git
synced 2024-08-14 23:51:41 +00:00
Attempt to log import errors. (#312)
This commit is contained in:
parent
c85cbf6034
commit
c7a0535039
2 changed files with 8 additions and 23 deletions
|
@ -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
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -982,6 +982,8 @@ public class ResponseHelper {
|
||||||
s.update(user);
|
s.update(user);
|
||||||
tr.commit();
|
tr.commit();
|
||||||
}
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
ExceptionHandler.handle(e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -996,6 +998,8 @@ public class ResponseHelper {
|
||||||
.findFirst().isEmpty()
|
.findFirst().isEmpty()
|
||||||
)
|
)
|
||||||
.forEach(channelId -> Multithreading.runAsyncLimited(() -> saveChannel(channelId)));
|
.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(),
|
var channel = new me.kavin.piped.utils.obj.db.Channel(channelId, info.getName(),
|
||||||
info.getAvatarUrl(), info.isVerified());
|
info.getAvatarUrl(), info.isVerified());
|
||||||
|
|
||||||
try (Session s = DatabaseSessionFactory.createSession()) {
|
try (StatelessSession s = DatabaseSessionFactory.createStatelessSession()) {
|
||||||
var tr = s.beginTransaction();
|
var tr = s.beginTransaction();
|
||||||
s.persist(channel);
|
s.insert(channel);
|
||||||
tr.commit();
|
tr.commit();
|
||||||
|
} catch (Exception e) {
|
||||||
|
ExceptionHandler.handle(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
Multithreading.runAsync(() -> {
|
Multithreading.runAsync(() -> {
|
||||||
|
|
Loading…
Reference in a new issue