mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 09:52:23 +01:00
Catch RejectedExecutionException at UncaughtExceptionHandler and log error instead calling the uncaughtExceptionHandler
Signed-off-by: HenrikJannsen <boilingfrog@gmx.com>
This commit is contained in:
parent
4c237dcf0d
commit
e0f4aa281a
@ -35,6 +35,7 @@ import java.net.URISyntaxException;
|
||||
|
||||
import java.nio.file.Paths;
|
||||
|
||||
import java.util.concurrent.RejectedExecutionException;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import ch.qos.logback.classic.Level;
|
||||
@ -72,13 +73,14 @@ public class CommonSetup {
|
||||
|
||||
public static void setupUncaughtExceptionHandler(UncaughtExceptionHandler uncaughtExceptionHandler) {
|
||||
Thread.UncaughtExceptionHandler handler = (thread, throwable) -> {
|
||||
// Might come from another thread
|
||||
if (throwable.getCause() != null && throwable.getCause().getCause() != null &&
|
||||
throwable.getCause().getCause() instanceof BlockStoreException) {
|
||||
log.error(throwable.getMessage());
|
||||
log.error("Uncaught BlockStoreException ", throwable);
|
||||
} else if (throwable instanceof ClassCastException &&
|
||||
"sun.awt.image.BufImgSurfaceData cannot be cast to sun.java2d.xr.XRSurfaceData".equals(throwable.getMessage())) {
|
||||
log.warn(throwable.getMessage());
|
||||
} else if (throwable instanceof RejectedExecutionException) {
|
||||
log.error("Uncaught RejectedExecutionException ", throwable);
|
||||
} else if (throwable instanceof UnsupportedOperationException &&
|
||||
"The system tray is not supported on the current platform.".equals(throwable.getMessage())) {
|
||||
log.warn(throwable.getMessage());
|
||||
|
Loading…
Reference in New Issue
Block a user