Skip to content

Commit f69c86a

Browse files
author
Tossaporn Jiw
committed
fix: handle key not found
Signed-off-by: Tossaporn Jiw <[email protected]>
1 parent eaa1c8a commit f69c86a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

notify/msteamsv2/msteamsv2.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ func (n *Notifier) Notify(ctx context.Context, as ...*types.Alert) (bool, error)
248248
},
249249
{
250250
Title: "Severity",
251-
Value: renderSeverity(data.CommonLabels["severity"]),
251+
Value: renderSeverity(extractKV(data.CommonLabels, "severity")),
252252
},
253253
{
254254
Title: "In Host",
@@ -322,7 +322,7 @@ func renderSeverity(severity string) string {
322322
case "info":
323323
return fmt.Sprintf("%s %s", severity, "ℹ️")
324324
default:
325-
return fmt.Sprintf("%s %s", severity, "ℹ❓")
325+
return "unknown ❓"
326326
}
327327
}
328328

0 commit comments

Comments
 (0)