Fixed: #1636 Exception on reloading (7)

This commit is contained in:
Jindra Petřík
2021-03-12 22:12:39 +01:00
parent 9ddc983a03
commit 8c988646f7
6 changed files with 57 additions and 6 deletions
@@ -53,6 +53,7 @@ import java.util.List;
import java.util.Timer;
import java.util.TimerTask;
import java.util.concurrent.CancellationException;
import java.util.concurrent.ExecutionException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.event.CaretEvent;
@@ -752,8 +753,16 @@ public class DecompiledEditorPane extends DebuggableEditorPane implements CaretL
} catch (CancellationException ex) {
setText("// " + AppStrings.translate("work.canceled"));
} catch (Exception ex) {
logger.log(Level.SEVERE, "Error", ex);
setText("// " + AppStrings.translate("decompilationError") + ": " + ex);
Throwable cause = ex;
if (ex instanceof ExecutionException) {
cause = ex.getCause();
}
if (cause instanceof CancellationException) {
setText("// " + AppStrings.translate("work.canceled"));
} else {
logger.log(Level.SEVERE, "Error", cause);
setText("// " + AppStrings.translate("decompilationError") + ": " + cause);
}
}
});
}