Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 80a6875

Browse files
committed
Throw better exception in corner cases
1 parent d94b2e5 commit 80a6875

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

‎src/JsonApiDotNetCore.Annotations/Configuration/ResourceType.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,6 @@ public AttrAttribute GetAttributeByPublicName(string publicName)
173173
public AttrAttribute GetAttributeByPropertyName(string propertyName)
174174
{
175175
AttrAttribute? attribute = FindAttributeByPropertyName(propertyName);
176-
177176
return attribute ?? throw new InvalidOperationException($"Attribute for property '{propertyName}' does not exist on resource type '{ClrType.Name}'.");
178177
}
179178

‎src/JsonApiDotNetCore/Configuration/ApplicationBuilderExtensions.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using JsonApiDotNetCore.Errors;
12
using JsonApiDotNetCore.Middleware;
23
using Microsoft.AspNetCore.Builder;
34
using Microsoft.Extensions.DependencyInjection;
@@ -60,7 +61,7 @@ private static void AssertAspNetCoreOpenApiIsNotRegistered(IServiceProvider serv
6061

6162
if (configureInstance != null)
6263
{
63-
throw new InvalidOperationException("JsonApiDotNetCore is incompatible with ASP.NET OpenAPI. " +
64+
throw new InvalidConfigurationException("JsonApiDotNetCore is incompatible with ASP.NET OpenAPI. " +
6465
"Replace 'services.AddOpenApi()' with 'services.AddOpenApiForJsonApi()' from the JsonApiDotNetCore.OpenApi.Swashbuckle NuGet package.");
6566
}
6667
}

‎src/JsonApiDotNetCore/Configuration/ResourceGraphBuilder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ private static void AssertNoInfiniteRecursion(int recursionDepth)
455455
{
456456
if (recursionDepth >= 500)
457457
{
458-
throw new InvalidOperationException("Infinite recursion detected in eager-load chain.");
458+
throw new InvalidConfigurationException("Infinite recursion detected in eager-load chain.");
459459
}
460460
}
461461

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /