Better error detection

This commit is contained in:
Anuken
2020-03-07 14:36:47 -05:00
parent c96427c722
commit 8b3d64a29a
2 changed files with 4 additions and 3 deletions

View File

@@ -180,9 +180,10 @@ public class DesktopLauncher extends ClientLauncher{
static void handleCrash(Throwable e){
Cons<Runnable> dialog = Runnable::run;
boolean badGPU = false;
String total = Strings.getCauses(e).toString();
if(e.getMessage() != null && (e.getMessage().contains("Couldn't create window") ||
e.getMessage().contains("OpenGL 2.0 or higher") || e.getMessage().toLowerCase().contains("pixel format") || e.getMessage().contains("GLEW"))){
if(total.contains("Couldn't create window") ||
total.contains("OpenGL 2.0 or higher") || total.toLowerCase().contains("pixel format") || total.contains("GLEW")){
dialog.get(() -> message(
e.getMessage().contains("Couldn't create window") ? "A graphics initialization error has occured! Try to update your graphics drivers:\n" + e.getMessage() :