Skip to content

Commit 04e23a5

Browse files
committed
[PLAT-1661] Fix alert messages for notification failures
Summary: In case of notification failures we're adding alert uuid to alert message instead of alert name. UUIDs say nothing to user. Test Plan: Emulate notification failure and check error message. Reviewers: spotachev Reviewed By: spotachev Subscribers: jenkins-bot, yugaware Differential Revision: https://phabricator.dev.yugabyte.com/D12908
1 parent 2b6f73b commit 04e23a5

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

managed/src/main/java/com/yugabyte/yw/common/alerts/impl/AlertChannelEmail.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,13 @@ public void sendNotification(Customer customer, Alert alert, AlertChannel channe
4040

4141
if (CollectionUtils.isEmpty(recipients)) {
4242
throw new PlatformNotificationException(
43-
String.format("Error sending email for alert %s: No recipients found.", alert.getUuid()));
43+
String.format("Error sending email for alert %s: No recipients found.", alert.getName()));
4444
}
4545

4646
if (smtpData == null) {
4747
throw new PlatformNotificationException(
4848
String.format(
49-
"Error sending email for alert %s: Invalid SMTP settings found.", alert.getUuid()));
49+
"Error sending email for alert %s: Invalid SMTP settings found.", alert.getName()));
5050
}
5151

5252
try {
@@ -58,7 +58,7 @@ public void sendNotification(Customer customer, Alert alert, AlertChannel channe
5858
Collections.singletonMap("text/plain; charset=\"us-ascii\"", text));
5959
} catch (MessagingException e) {
6060
throw new PlatformNotificationException(
61-
String.format("Error sending email for alert %s: %s", alert.getUuid(), e.getMessage()),
61+
String.format("Error sending email for alert %s: %s", alert.getName(), e.getMessage()),
6262
e);
6363
}
6464
}

managed/src/main/java/com/yugabyte/yw/common/alerts/impl/AlertChannelSlack.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public void sendNotification(Customer customer, Alert alert, AlertChannel channe
5252
} catch (IOException e) {
5353
throw new PlatformNotificationException(
5454
String.format(
55-
"Error sending Slack message for alert %s: %s", alert.getUuid(), e.getMessage()),
55+
"Error sending Slack message for alert %s: %s", alert.getName(), e.getMessage()),
5656
e);
5757
}
5858
}

0 commit comments

Comments
 (0)