From 26111456621034af7ac1a21ba687e8e0835d8825 Mon Sep 17 00:00:00 2001 From: Konloch Date: Wed, 2 Oct 2024 19:26:08 -0600 Subject: [PATCH] Krakatau Disassembler Simulated Errors --- .../decompilers/impl/KrakatauDisassembler.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/impl/KrakatauDisassembler.java b/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/impl/KrakatauDisassembler.java index a12ff775..3f3a64fb 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/impl/KrakatauDisassembler.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/impl/KrakatauDisassembler.java @@ -35,6 +35,7 @@ import the.bytecode.club.bytecodeviewer.util.ZipUtils; import java.io.*; import static the.bytecode.club.bytecodeviewer.Constants.*; +import static the.bytecode.club.bytecodeviewer.translation.TranslatedStrings.DEV_MODE_SIMULATED_ERROR; /** * Krakatau Java Disassembler Wrapper, requires Python 2.7 @@ -105,6 +106,10 @@ public class KrakatauDisassembler extends AbstractDecompiler log.append(NL).append(NL).append(TranslatedStrings.EXIT_VALUE_IS).append(" ").append(exitValue); returnString = log.toString(); + //handle simulated errors + if(Constants.DEV_FLAG_DECOMPILERS_SIMULATED_ERRORS) + throw new RuntimeException(DEV_MODE_SIMULATED_ERROR.toString()); + // update the string on a successful disassemble returnString = DiskReader.loadAsString(tempDirectory.getAbsolutePath() + FS + cn.name + ".j"); }