Skip to content

Commit 0b01532

Browse files
committed
fix: Improved exceptions for missing types
1 parent 64ee569 commit 0b01532

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

src/Framework/Infrastructure/Infrastructure.Common/DomainFactory.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,14 +98,14 @@ object CheckMethodSignatureAndInvoke(MethodInfo? methodInfo, Type type)
9898
if (methodInfo.NotExists())
9999
{
100100
throw new InvalidOperationException(
101-
Resources.DomainFactory_AggregateRootFactoryMethodNotFound.Format(type.Name,
101+
Resources.DomainFactory_AggregateRootFactoryMethodNotFound.Format(type.ToString(),
102102
FactoryMethodName));
103103
}
104104

105105
if (IsWrongNamedOrHasParameters(methodInfo))
106106
{
107107
throw new InvalidOperationException(
108-
Resources.DomainFactory_FactoryMethodHasParameters.Format(type.Name,
108+
Resources.DomainFactory_FactoryMethodHasParameters.Format(type.ToString(),
109109
methodInfo.Name, FactoryMethodName));
110110
}
111111

@@ -121,7 +121,7 @@ public IDehydratableAggregateRoot RehydrateAggregateRoot(Type aggregateType,
121121
if (!_aggregateRootFactories.ContainsKey(aggregateType))
122122
{
123123
throw new InvalidOperationException(
124-
Resources.DomainFactory_AggregateTypeNotFound.Format(aggregateType.Name));
124+
Resources.DomainFactory_AggregateTypeNotFound.Format(aggregateType.ToString()));
125125
}
126126

127127
var identifier =
@@ -138,7 +138,7 @@ public IDehydratableEntity RehydrateEntity(Type entityType,
138138
var baseEntityType = GetBaseType(entityType);
139139
if (!_persistableEntityFactories.ContainsKey(baseEntityType))
140140
{
141-
throw new InvalidOperationException(Resources.DomainFactory_EntityTypeNotFound.Format(entityType.Name));
141+
throw new InvalidOperationException(Resources.DomainFactory_EntityTypeNotFound.Format(entityType.ToString()));
142142
}
143143

144144
var identifier =
@@ -156,7 +156,7 @@ public IDehydratableValueObject RehydrateValueObject(Type valueObjectType, strin
156156
if (!_valueObjectFactories.ContainsKey(baseValueObjectType))
157157
{
158158
throw new InvalidOperationException(
159-
Resources.DomainFactory_ValueObjectTypeNotFound.Format(valueObjectType.Name));
159+
Resources.DomainFactory_ValueObjectTypeNotFound.Format(valueObjectType.ToString()));
160160
}
161161

162162
return _valueObjectFactories[baseValueObjectType](rehydratingPropertyValue, _container);

src/Framework/Infrastructure/Infrastructure.Common/Infrastructure.Common.csproj

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@
1515
</ItemGroup>
1616

1717
<ItemGroup>
18-
<PackageReference Include="AWSSDK.CloudWatch" Version="3.7.304.21" Condition="'$(HostingPlatform)' == 'HOSTEDONAWS'" />
19-
<PackageReference Include="AWSSDK.CloudWatchLogs" Version="3.7.302.9" Condition="'$(HostingPlatform)' == 'HOSTEDONAWS'" />
20-
<PackageReference Include="Microsoft.ApplicationInsights" Version="2.23.0" Condition="'$(HostingPlatform)' == 'HOSTEDONAZURE'" />
2118
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
2219
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.3" />
2320
</ItemGroup>

0 commit comments

Comments
 (0)