Skip to content

Commit e4328f0

Browse files
committed
Throw InvalidDataException instead of Exception
1 parent 6846cd1 commit e4328f0

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

tests/PublicApi.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
using System;
21
using System.IO;
32
using System.Reflection;
43
using System.Runtime.CompilerServices;
@@ -19,7 +18,7 @@ public Task ApprovePublicApi(string targetFramework)
1918
{
2019
var testAssembly = typeof(PublicApi).Assembly;
2120
var configuration = testAssembly.GetCustomAttribute<AssemblyConfigurationAttribute>()?.Configuration
22-
?? throw new Exception($"{nameof(AssemblyConfigurationAttribute)} not found in {testAssembly.Location}");
21+
?? throw new InvalidDataException($"{nameof(AssemblyConfigurationAttribute)} not found in {testAssembly.Location}");
2322
var assemblyPath = Path.Combine(GetSrcDirectoryPath(), "bin", configuration, targetFramework, "Serilog.Formatting.Log4Net.dll");
2423
var assembly = Assembly.LoadFile(assemblyPath);
2524
var publicApi = assembly.GeneratePublicApi();
@@ -35,7 +34,7 @@ public TargetFrameworksTheoryData()
3534
var csprojPath = Path.Combine(GetSrcDirectoryPath(), "Serilog.Formatting.Log4Net.csproj");
3635
var project = XDocument.Load(csprojPath);
3736
var targetFrameworks = project.XPathSelectElement("/Project/PropertyGroup/TargetFrameworks")
38-
?? throw new Exception($"TargetFrameworks element not found in {csprojPath}");
37+
?? throw new InvalidDataException($"TargetFrameworks element not found in {csprojPath}");
3938
AddRange(targetFrameworks.Value.Split(';'));
4039
}
4140
}

0 commit comments

Comments
 (0)