GUACAMOLE-362: Debug should throw full exception, not just getMessage() output.
Project: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/commit/c3aaf0aa Tree: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/tree/c3aaf0aa Diff: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/diff/c3aaf0aa Branch: refs/heads/master Commit: c3aaf0aa032713e70c72326e19e3733db8f7670f Parents: 87fba0e Author: Nick Couchman <vn...@apache.org> Authored: Wed Aug 23 10:27:09 2017 -0400 Committer: Nick Couchman <nick.couch...@yahoo.com> Committed: Fri Oct 27 13:05:12 2017 -0400 ---------------------------------------------------------------------- .../auth/cas/AuthenticationProviderService.java | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/c3aaf0aa/extensions/guacamole-auth-cas/src/main/java/org/apache/guacamole/auth/cas/AuthenticationProviderService.java ---------------------------------------------------------------------- diff --git a/extensions/guacamole-auth-cas/src/main/java/org/apache/guacamole/auth/cas/AuthenticationProviderService.java b/extensions/guacamole-auth-cas/src/main/java/org/apache/guacamole/auth/cas/AuthenticationProviderService.java index 1797060..feb842d 100644 --- a/extensions/guacamole-auth-cas/src/main/java/org/apache/guacamole/auth/cas/AuthenticationProviderService.java +++ b/extensions/guacamole-auth-cas/src/main/java/org/apache/guacamole/auth/cas/AuthenticationProviderService.java @@ -27,6 +27,7 @@ import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.InputStream; import java.io.IOException; +import java.lang.IllegalArgumentException; import java.security.InvalidKeyException; import java.security.KeyFactory; import java.security.NoSuchAlgorithmException; @@ -190,27 +191,32 @@ public class AuthenticationProviderService { } catch (FileNotFoundException e) { logger.error("ClearPass key file not found, password will not be decrypted."); - logger.debug("Error locating the ClearPass key file: {}", e.getMessage()); + logger.debug("Error locating the ClearPass key file: {}", e); return null; } catch (IOException e) { logger.error("Error reading ClearPass key file, password will not be decrypted."); - logger.debug("Error reading the ClearPass key file: {}", e.getMessage()); + logger.debug("Error reading the ClearPass key file: {}", e); return null; } catch (NoSuchAlgorithmException e) { logger.error("Unable to find the specified algorithm, password will not be decrypted."); - logger.debug("Algorithm was not found: {}", e.getMessage()); + logger.debug("Algorithm was not found: {}", e); return null; } catch (InvalidKeyException e) { logger.error("Invalid key was loaded, password will not be decrypted."); - logger.debug("The loaded key was invalid: {}", e.getMessage()); + logger.debug("The loaded key was invalid: {}", e); + return null; + } + catch (IllegalArgumentException e) { + logger.error("Failed to parse Base64 data, password will not be decrypted."); + logger.debug("Data received was not valid Base64 data, so decryption cannot continue: {}", e); return null; } catch (Throwable t) { logger.error("Error decrypting password, it will not be available as a token."); - logger.debug("Error in one of the components to decrypt the password: {}", t.getMessage()); + logger.debug("Error in one of the components to decrypt the password: {}", t); return null; }