Skip to content

Commit

Permalink
Merge pull request #6 from atc-net/feature/chore
Browse files Browse the repository at this point in the history
use nameof in ServiceCollectionExtensions to resolve type-name for exception message
  • Loading branch information
perkops authored May 18, 2024
2 parents a9ff145 + 8c7855b commit cb6690b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Atc.Azure.IoT/Extensions/ServiceCollectionExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public static IServiceCollection ConfigureIotHubServices(
if (iotHubOptions is null ||
string.IsNullOrEmpty(iotHubOptions.ConnectionString))
{
throw new InvalidOperationException("Required service 'IotHubOptions' is not registered");
throw new InvalidOperationException($"Required service '{nameof(IotHubOptions)}' is not registered");
}

services.TryAddSingleton<IDeviceTwinModuleExtractor, DeviceTwinModuleExtractor>();
Expand Down Expand Up @@ -53,7 +53,7 @@ public static IServiceCollection ConfigureDeviceProvisioningServices(
if (deviceProvisioningServiceOptions is null ||
string.IsNullOrEmpty(deviceProvisioningServiceOptions.ConnectionString))
{
throw new InvalidOperationException("Required service 'DeviceProvisioningServiceOptions' is not registered");
throw new InvalidOperationException($"Required service '{nameof(DeviceProvisioningServiceOptions)}' is not registered");
}

services.AddSingleton<IDeviceProvisioningService, DeviceProvisioningService>(s => new DeviceProvisioningService(
Expand Down

0 comments on commit cb6690b

Please sign in to comment.