|
44 | 44 | import org.runejs.Configuration;
|
45 | 45 |
|
46 | 46 | import java.awt.*;
|
47 |
| -import java.io.DataInputStream; |
| 47 | +import java.io.*; |
48 | 48 | import java.net.URL;
|
49 | 49 | import java.nio.charset.StandardCharsets;
|
50 | 50 | import java.text.MessageFormat;
|
@@ -565,7 +565,7 @@ public static void printException(String arg0, Throwable exception) {
|
565 | 565 | try {
|
566 | 566 | String string = "";
|
567 | 567 | if (exception != null)
|
568 |
| - string = Class55.parseException(exception); |
| 568 | + string = parseException(exception); |
569 | 569 | if (arg0 != null) {
|
570 | 570 | if (exception != null)
|
571 | 571 | string += " | ";
|
@@ -2756,4 +2756,44 @@ public static void drawTabGraphics() {
|
2756 | 2756 | MouseHandler.gameCanvas.repaint();
|
2757 | 2757 | }
|
2758 | 2758 | }
|
| 2759 | + |
| 2760 | + public static String parseException(Throwable exception) throws IOException { |
| 2761 | + String string; |
| 2762 | + if(exception instanceof RSRuntimeException) { |
| 2763 | + RSRuntimeException runtimeexception_sub1 = (RSRuntimeException) exception; |
| 2764 | + string = runtimeexception_sub1.aString1653 + " | "; |
| 2765 | + exception = runtimeexception_sub1.aThrowable1652; |
| 2766 | + } else |
| 2767 | + string = ""; |
| 2768 | + StringWriter stringwriter = new StringWriter(); |
| 2769 | + PrintWriter printwriter = new PrintWriter(stringwriter); |
| 2770 | + exception.printStackTrace(printwriter); |
| 2771 | + printwriter.close(); |
| 2772 | + String string_0_ = stringwriter.toString(); |
| 2773 | + BufferedReader bufferedreader = new BufferedReader(new StringReader(string_0_)); |
| 2774 | + String string_1_ = bufferedreader.readLine(); |
| 2775 | + for(; ; ) { |
| 2776 | + String string_2_ = bufferedreader.readLine(); |
| 2777 | + if(string_2_ == null) |
| 2778 | + break; |
| 2779 | + int i = string_2_.indexOf('('); |
| 2780 | + int i_3_ = string_2_.indexOf(')', i + 1); |
| 2781 | + if(i >= 0 && i_3_ >= 0) { |
| 2782 | + String string_4_ = string_2_.substring(1 + i, i_3_); |
| 2783 | + int i_5_ = string_4_.indexOf(".java:"); |
| 2784 | + if(i_5_ >= 0) { |
| 2785 | + string_4_ = string_4_.substring(0, i_5_) + string_4_.substring(5 + i_5_); |
| 2786 | + string += string_4_ + ' '; |
| 2787 | + continue; |
| 2788 | + } |
| 2789 | + string_2_ = string_2_.substring(0, i); |
| 2790 | + } |
| 2791 | + string_2_ = string_2_.trim(); |
| 2792 | + string_2_ = string_2_.substring(1 + string_2_.lastIndexOf(' ')); |
| 2793 | + string_2_ = string_2_.substring(1 + string_2_.lastIndexOf('\t')); |
| 2794 | + string += string_2_ + ' '; |
| 2795 | + } |
| 2796 | + string += "| " + string_1_; |
| 2797 | + return string; |
| 2798 | + } |
2759 | 2799 | }
|
0 commit comments