Skip to content

Commit

Permalink
add try block
Browse files Browse the repository at this point in the history
  • Loading branch information
sarah-witt committed Jun 26, 2024
1 parent 1b80547 commit 715bec4
Showing 1 changed file with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,16 @@ private static String getJobName(Task task) {
WorkflowJob workflowJob = (WorkflowJob) task;
return workflowJob.getFullName();
}
if (task != null) {
logger.info(String.format("Unknown job found: %s, %s", task.getDisplayName(), task.getUrl()));
} else {
logger.info(String.format("Null task found"));
try {
if (task != null) {
logger.info(String.format("Unknown job found: %s, %s", task.getDisplayName(), task.getUrl()));
} else {
logger.info("Null task found");

}
}
catch (Exception e) {
logger.info("Failed to collect unknown job name");
}
return "unknown";
}
Expand Down

0 comments on commit 715bec4

Please sign in to comment.