mike-jumper commented on code in PR #762:
URL: https://github.com/apache/guacamole-client/pull/762#discussion_r982786158
##########
guacamole/src/main/java/org/apache/guacamole/rest/auth/GuacamoleAuthenticationProcessException.java:
##########
@@ -146,6 +146,38 @@ public GuacamoleException getCauseAsGuacamoleException() {
return guacCause;
}
+ /**
+ * Rethrows the original GuacamoleException wrapped within this
+ * GuacamoleAuthenticationProcessException. If there is no such exception,
+ * and the cause of this failure is an unchecked RuntimeException or Error,
+ * that unchecked exception/error is rethrown as-is.
+ *
+ * @throws GuacamoleException
+ * If the underlying cause of this exception is a checked
+ * GuacamoleException subclass.
+ *
+ * @throws RuntimeException
+ * If the underlying cause of this exception is an unchecked
+ * RuntimeException.
+ *
+ * @throws Error
+ * If the underlying cause of this exception is an unchecked Error.
+ */
+ public void rethrowCause() throws GuacamoleException, RuntimeException,
Error {
+
+ // Rethrow any unchecked exceptions/errors as-is
+ Throwable cause = getCause();
+ if (cause instanceof RuntimeException)
+ throw (RuntimeException) cause;
Review Comment:
Yep, it needs some handholding here.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]