Re-wrap throwable if is not a runtime excepton, otherwise just throw original object for clearer error messages

This commit is contained in:
codeanticode
2012-09-10 18:36:31 +00:00
parent ea9dedef16
commit 502ef5efe0

View File

@@ -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);
}
}
}
}