(CrashReport crashReport, CrashReportCategory category)
| 13 | public class CrashReporter |
| 14 | { |
| 15 | public static void onCrashReport(CrashReport crashReport, CrashReportCategory category) |
| 16 | { |
| 17 | try |
| 18 | { |
| 19 | Throwable throwable = crashReport.getCrashCause(); |
| 20 | |
| 21 | if (throwable == null) |
| 22 | { |
| 23 | return; |
| 24 | } |
| 25 | |
| 26 | if (throwable.getClass().getName().contains(".fml.client.SplashProgress")) |
| 27 | { |
| 28 | return; |
| 29 | } |
| 30 | |
| 31 | if (throwable.getClass() == Throwable.class) |
| 32 | { |
| 33 | return; |
| 34 | } |
| 35 | |
| 36 | extendCrashReport(category); |
| 37 | GameSettings gamesettings = Config.getGameSettings(); |
| 38 | |
| 39 | if (gamesettings == null) |
| 40 | { |
| 41 | return; |
| 42 | } |
| 43 | |
| 44 | if (!gamesettings.snooperEnabled) |
| 45 | { |
| 46 | return; |
| 47 | } |
| 48 | |
| 49 | String s = "http://optifine.net/crashReport"; |
| 50 | String s1 = makeReport(crashReport); |
| 51 | byte[] abyte = s1.getBytes("ASCII"); |
| 52 | IFileUploadListener ifileuploadlistener = new IFileUploadListener() |
| 53 | { |
| 54 | public void fileUploadFinished(String url, byte[] content, Throwable exception) |
| 55 | { |
| 56 | } |
| 57 | }; |
| 58 | Map map = new HashMap(); |
| 59 | map.put("OF-Version", Config.getVersion()); |
| 60 | map.put("OF-Summary", makeSummary(crashReport)); |
| 61 | FileUploadThread fileuploadthread = new FileUploadThread(s, map, abyte, ifileuploadlistener); |
| 62 | fileuploadthread.setPriority(10); |
| 63 | fileuploadthread.start(); |
| 64 | Thread.sleep(1000L); |
| 65 | } |
| 66 | catch (Exception exception) |
| 67 | { |
| 68 | Config.dbg(exception.getClass().getName() + ": " + exception.getMessage()); |
| 69 | } |
| 70 | } |
| 71 | |
| 72 | private static String makeReport(CrashReport crashReport) |
no test coverage detected