better exception handling, fixes #3293

This commit is contained in:
codeanticode
2015-05-18 11:09:10 -04:00
parent 702785eb0a
commit 4c445f6f99
+7 -4
View File
@@ -268,10 +268,13 @@ public class PSurfaceJOGL implements PSurface {
e.printStackTrace();
}
// System.err.println("Caught exception: " + drawException.getMessage());
if (drawException instanceof RuntimeException) {
throw (RuntimeException)drawException.getCause();
} else {
throw new RuntimeException(drawException.getCause());
if (drawException != null) {
Throwable cause = drawException.getCause();
if (cause instanceof RuntimeException) {
throw (RuntimeException)cause;
} else if (!(cause instanceof java.lang.ThreadDeath)) {
throw new RuntimeException(cause);
}
}
}
}