Skip to content

Commit e7c828a

Browse files
committed
Added support for arrays in "ErrTags"
1 parent f7124eb commit e7c828a

File tree

2 files changed

+20
-13
lines changed

2 files changed

+20
-13
lines changed

src/Server/Coderr.Server.App/Modules/Tagging/Handlers/IdentifyTagsFromIncident.cs

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -62,23 +62,31 @@ private void ExtractTagsFromCollections(ReportAddedToIncident e, TagIdentifierCo
6262
{
6363
foreach (var collection in e.Report.ContextCollections)
6464
{
65-
if (!collection.Properties.TryGetValue("OneTrueTags", out var tagsStr)
66-
&& !collection.Properties.TryGetValue("ErrTags", out tagsStr))
67-
continue;
68-
69-
try
65+
// Comma seperated tags
66+
if (collection.Properties.TryGetValue("OneTrueTags", out var tagsStr)
67+
&& collection.Properties.TryGetValue("ErrTags", out tagsStr))
7068
{
71-
var tags = tagsStr.Split(',');
72-
foreach (var tag in tags)
69+
try
70+
{
71+
var tags = tagsStr.Split(',');
72+
foreach (var tag in tags)
73+
{
74+
ctx.AddTag(tag, 1);
75+
}
76+
}
77+
catch (Exception ex)
7378
{
74-
ctx.AddTag(tag, 1);
79+
_logger.Error(
80+
"Failed to parse tags from '" + collection.Name + "', invalid tag string: '" + tagsStr + "'.",
81+
ex);
7582
}
7683
}
77-
catch (Exception ex)
84+
85+
//Tag array
86+
foreach (var property in collection.Properties)
7887
{
79-
_logger.Error(
80-
"Failed to parse tags from '" + collection.Name + "', invalid tag string: '" + tagsStr + "'.",
81-
ex);
88+
if (property.Key.StartsWith("ErrTags["))
89+
ctx.AddTag(property.Value, 1);
8290
}
8391
}
8492
}

src/Server/Coderr.Server.Web/Scripts/Griffin.Yo.js

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)