Skip to content

Commit 1f6eebd

Browse files
committed
Improve error message for invalid version increments
1 parent b3085d3 commit 1f6eebd

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/NerdBank.GitVersioning/ReleaseManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ private SemanticVersion GetNextDevVersion(VersionOptions versionOptions, Semanti
289289
// increment is ignored when the next version was specified explicitly
290290
if (!isValidIncrement)
291291
{
292-
this.stderr.WriteLine($"Cannot use version increment 'build' in version '{versionOptions.Version}' because it only has major and minor segments");
292+
this.stderr.WriteLine($"Cannot apply version increment 'build' to version '{versionOptions.Version}' because it only has major and minor segments");
293293
throw new ReleasePreparationException(ReleasePreparationError.InvalidVersionIncrementSetting);
294294
}
295295

src/NerdBank.GitVersioning/SemanticVersionExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ internal static SemanticVersion Increment(this SemanticVersion currentVersion, V
1818
{
1919
Requires.NotNull(currentVersion, nameof(currentVersion));
2020
Requires.That(increment != VersionOptions.ReleaseVersionIncrement.Build || currentVersion.Version.Build >= 0, nameof(increment),
21-
"Cannot use increment '{0}' with higher precision than the version being incremented", increment);
21+
"Cannot apply version increment '{0}' to version '{1}'", increment, currentVersion);
2222

2323
var major = currentVersion.Version.Major;
2424
var minor = currentVersion.Version.Minor;

0 commit comments

Comments
 (0)