fix(multivalue): NJ-3/NJ-4/NJ-5 review fixes
- NJ-3: widen per-row catch to Exception (an STJ encode failure can't abort startup); drop dead null-guard already excluded by the SQL filter - NJ-4: capture logger/instanceName in locals for the fire-and-forget normalize continuation (match the sibling pattern in this actor) - NJ-5: emit a warn-log when a malformed List value is imported verbatim; thread an optional ILogger<BundleImporter> to the sync re-import site
This commit is contained in:
@@ -54,10 +54,13 @@ public static class ListValueNormalizer
|
||||
rewritten++;
|
||||
}
|
||||
}
|
||||
catch (FormatException ex)
|
||||
catch (Exception ex)
|
||||
{
|
||||
// Never abort startup for a single bad row. FormatException from Decode is the
|
||||
// expected case; the broad catch also covers an unexpected serialize failure
|
||||
// (e.g. a JsonException on a non-finite value) so one poison row can't crash boot.
|
||||
logger?.LogWarning(ex,
|
||||
"List value normalizer: skipping unparseable list value for TemplateAttribute {Id}.",
|
||||
"List value normalizer: skipping unprocessable list value for TemplateAttribute {Id}.",
|
||||
a.Id);
|
||||
}
|
||||
}
|
||||
@@ -71,14 +74,6 @@ public static class ListValueNormalizer
|
||||
|
||||
foreach (var o in overrideRows)
|
||||
{
|
||||
if (o.ElementDataType is null)
|
||||
{
|
||||
logger?.LogDebug(
|
||||
"List value normalizer: skipping InstanceAttributeOverride {Id} with no element type.",
|
||||
o.Id);
|
||||
continue;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
var native = AttributeValueCodec.Encode(
|
||||
@@ -89,10 +84,10 @@ public static class ListValueNormalizer
|
||||
rewritten++;
|
||||
}
|
||||
}
|
||||
catch (FormatException ex)
|
||||
catch (Exception ex)
|
||||
{
|
||||
logger?.LogWarning(ex,
|
||||
"List value normalizer: skipping unparseable list value for InstanceAttributeOverride {Id}.",
|
||||
"List value normalizer: skipping unprocessable list value for InstanceAttributeOverride {Id}.",
|
||||
o.Id);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user