Skip to content

Commit 78e9c4a

Browse files
authored
Merge pull request #1 from WorkingRobot/main
Swap breaking change error reporting order for more informative errors
2 parents eb4b82e + 3737ff1 commit 78e9c4a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

BreakingValidators/FieldNamesAndTypes.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@ public static void Validate(Sheet baseSheet, Sheet newSheet, IReadOnlyList<Excel
1616

1717
private static void ValidateFields(List<Field> baseFields, List<Field> newFields)
1818
{
19-
if (baseFields.Count != newFields.Count)
20-
throw new ValidationException("Field count mismatch");
21-
2219
foreach (var field in baseFields)
2320
{
2421
var newField = newFields.FirstOrDefault(x => x.Name == field.Name);
@@ -50,6 +47,9 @@ private static void ValidateFields(List<Field> baseFields, List<Field> newFields
5047
throw new ValidationException($"Field '{field.Name}' cannot remove targets ({string.Join(", ", targetList)})");
5148
}
5249
}
50+
51+
if (baseFields.Count != newFields.Count)
52+
throw new ValidationException("Field count mismatch");
5353
}
5454

5555
private static void ValidateRelations(Dictionary<string, List<string>>? baseRelations, Dictionary<string, List<string>>? newRelations)
@@ -69,4 +69,4 @@ private static void ValidateRelations(Dictionary<string, List<string>>? baseRela
6969
throw new ValidationException($"Relation '{name}' field list mismatch");
7070
}
7171
}
72-
}
72+
}

0 commit comments

Comments
 (0)