From 502ef5efe052d9ff42bcdb412da8bed297ca3bfa Mon Sep 17 00:00:00 2001 From: codeanticode Date: Mon, 10 Sep 2012 18:36:31 +0000 Subject: [PATCH] Re-wrap throwable if is not a runtime excepton, otherwise just throw original object for clearer error messages --- core/src/processing/opengl/PGL.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/src/processing/opengl/PGL.java b/core/src/processing/opengl/PGL.java index 964efa98a..0c2bb3e66 100644 --- a/core/src/processing/opengl/PGL.java +++ b/core/src/processing/opengl/PGL.java @@ -1013,7 +1013,11 @@ public class PGL { } catch (GLException e) { // Unwrap GLException so that only the causing exception is shown. Throwable tr = e.getCause(); - throw new RuntimeException(tr); + if (tr instanceof RuntimeException) { + throw (RuntimeException)tr; + } else { + throw new RuntimeException(tr); + } } } }