Skip to content

Commit

Permalink
fix: handle key not found
Browse files Browse the repository at this point in the history
Signed-off-by: Tossaporn Jiw <[email protected]>
  • Loading branch information
Tossaporn Jiw committed Feb 26, 2025
1 parent eaa1c8a commit f69c86a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions notify/msteamsv2/msteamsv2.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ func (n *Notifier) Notify(ctx context.Context, as ...*types.Alert) (bool, error)
},
{
Title: "Severity",
Value: renderSeverity(data.CommonLabels["severity"]),
Value: renderSeverity(extractKV(data.CommonLabels, "severity")),
},
{
Title: "In Host",
Expand Down Expand Up @@ -322,7 +322,7 @@ func renderSeverity(severity string) string {
case "info":
return fmt.Sprintf("%s %s", severity, "ℹ️")
default:
return fmt.Sprintf("%s %s", severity, "ℹ❓")
return "unknown ❓"
}
}

Expand Down

0 comments on commit f69c86a

Please sign in to comment.