Skip to content

Commit ce50e21

Browse files
authored
Merge pull request #1191 from ANGEL-OF-DEV/fix/VersionFile-JSON-exceptions-handling
Catch a more general JsonException.
2 parents bba85d9 + 43b9380 commit ce50e21

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/NerdBank.GitVersioning/VersionFile.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ public string SetVersion(string projectDirectory, VersionOptions version, bool i
123123
}
124124

125125
/// <summary>
126-
/// Tries to read a version.json file from the specified string, but favors returning null instead of throwing a <see cref="JsonSerializationException"/>.
126+
/// Tries to read a version.json file from the specified string, but favors returning null instead of throwing a <see cref="JsonException"/>.
127127
/// </summary>
128128
/// <param name="jsonContent">The content of the version.json file.</param>
129129
/// <param name="repoRelativeBaseDirectory">Directory that this version.json file is relative to the root of the repository.</param>
@@ -134,7 +134,7 @@ public string SetVersion(string projectDirectory, VersionOptions version, bool i
134134
{
135135
return JsonConvert.DeserializeObject<VersionOptions>(jsonContent, VersionOptions.GetJsonSettings(repoRelativeBaseDirectory: repoRelativeBaseDirectory));
136136
}
137-
catch (JsonSerializationException)
137+
catch (JsonException)
138138
{
139139
return null;
140140
}

0 commit comments

Comments
 (0)