Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Jesse Glick <[email protected]>
  • Loading branch information
LinuxSuRen and jglick committed Apr 9, 2021
1 parent b2d93fe commit 8655ada
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -251,20 +251,18 @@ public HttpResponse doAbort() {
private void notifyInput(InputExtension.InputEvent inputEvent) {
InputStep inputStep = this.getInput();
Jenkins.get().getExtensionList(InputExtension.class).forEach(input -> {
final String extensionName = input.getClass().getSimpleName();

User currentUser = User.current();
final String userID;
if(currentUser != null) {
userID = currentUser.getId();
} else {
userID = "anonymous";
userID = null;
}

try {
input.notifyInput(inputStep, run, userID, listener, inputEvent);
} catch (Exception e) {
LOGGER.log(Level.WARNING, String.format("Notification for %s occurred error.", extensionName), e);
LOGGER.log(Level.WARNING, null, e);
}
});
}
Expand Down

0 comments on commit 8655ada

Please sign in to comment.