Skip to content

Commit

Permalink
[Fix JENKINS-16632] Don't print auth stack traces.
Browse files Browse the repository at this point in the history
Really fix JENKINS-16632. We cannot print the AuthorizationException
stack trace because it contains private auth info and printing the stack
trace writes it to the Jenkins build console log. Instead catch
AuthorizationExceptions then create a new RuntimeException whose message
can be printed. Print the RuntimeException stack trace and a helpful
message that authorization failed.
  • Loading branch information
cboylan committed Feb 25, 2013
1 parent 01991c6 commit 8b55b2f
Showing 1 changed file with 3 additions and 1 deletion.
Expand Up @@ -161,7 +161,9 @@ public boolean perform(AbstractBuild<?, ?> build,
}
} catch (AuthorizationException e) {
LOGGER.severe("Failed to upload files to Blob Store due to authorization exception.");
e.printStackTrace(listener.error("Failed to upload files"));
RuntimeException overrideException =
new RuntimeException("Failed to upload files to Blob Store due to authorization exception.");
overrideException.printStackTrace(listener.error("Failed to upload files"));
build.setResult(Result.UNSTABLE);
} catch (IOException e) {
LOGGER.severe("Failed to upload files to Blob Store: " + e.getMessage());
Expand Down

0 comments on commit 8b55b2f

Please sign in to comment.