Catch exceptions in ProfileFetchThread

This commit is contained in:
fullwall 2023-08-12 20:42:45 +08:00
parent eeea90ea05
commit 583e633228

View File

@ -192,16 +192,15 @@ class ProfileFetchThread implements Runnable {
queue.clear(); queue.clear();
} }
fetchRequests(requests); try {
fetchRequests(requests);
} catch (Exception ex) {
Messaging.severe("Error fetching skins: " + ex.getMessage());
}
} }
private static void addHandler(final ProfileRequest request, final ProfileFetchHandler handler) { private static void addHandler(final ProfileRequest request, final ProfileFetchHandler handler) {
Bukkit.getScheduler().scheduleSyncDelayedTask(CitizensAPI.getPlugin(), new Runnable() { Bukkit.getScheduler().scheduleSyncDelayedTask(CitizensAPI.getPlugin(), () -> request.addHandler(handler), 1);
@Override
public void run() {
request.addHandler(handler);
}
}, 1);
} }
@Nullable @Nullable