Skip to content

Commit 2611145

Browse files
committed
Krakatau Disassembler Simulated Errors
1 parent f749603 commit 2611145

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/main/java/the/bytecode/club/bytecodeviewer/decompilers/impl/KrakatauDisassembler.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
import java.io.*;
3636

3737
import static the.bytecode.club.bytecodeviewer.Constants.*;
38+
import static the.bytecode.club.bytecodeviewer.translation.TranslatedStrings.DEV_MODE_SIMULATED_ERROR;
3839

3940
/**
4041
* Krakatau Java Disassembler Wrapper, requires Python 2.7
@@ -105,6 +106,10 @@ public String decompileClassNode(ClassNode cn, byte[] bytes)
105106
log.append(NL).append(NL).append(TranslatedStrings.EXIT_VALUE_IS).append(" ").append(exitValue);
106107
returnString = log.toString();
107108

109+
//handle simulated errors
110+
if(Constants.DEV_FLAG_DECOMPILERS_SIMULATED_ERRORS)
111+
throw new RuntimeException(DEV_MODE_SIMULATED_ERROR.toString());
112+
108113
// update the string on a successful disassemble
109114
returnString = DiskReader.loadAsString(tempDirectory.getAbsolutePath() + FS + cn.name + ".j");
110115
}

0 commit comments

Comments
 (0)