We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RegistryManager.GetDeviceAsync (string deviceId) returns a null if device is not found. Per Code Expected DeviceNotFoundException
{ if (Logging.IsEnabled) Logging.Enter(this, $"Getting device: {deviceId}", nameof(GetDeviceAsync)); try { if (string.IsNullOrWhiteSpace(deviceId)) { throw new ArgumentException(IotHubApiResources.GetString(ApiResources.ParameterCannotBeNullOrWhitespace, "deviceId")); } EnsureInstanceNotClosed(); var errorMappingOverrides = new Dictionary<HttpStatusCode, Func<HttpResponseMessage, Task<Exception>>>() { { HttpStatusCode.NotFound, async responseMessage => new DeviceNotFoundException(await ExceptionHandlingHelper.GetExceptionMessageAsync(responseMessage).ConfigureAwait(false)) } }; return _httpClientHelper.GetAsync<Device>(GetRequestUri(deviceId), errorMappingOverrides, null, false, cancellationToken);
[Fact] public async Task TestRegistryManager() { var registry = RegistryManager.CreateFromConnectionString(connectionString); await Assert.ThrowsAsync<DeviceNotFoundException>(async () => await registry.GetDeviceAsync("IDoNoTExist") ); }
Follow the instructions here to capture SDK logs. Don't forget to remove any connection string information!
The text was updated successfully, but these errors were encountered:
Documentation update to be clear non this behavior might be sufficient, but the DFE matches what is received from rest of SDK.
Sorry, something went wrong.
No branches or pull requests
Context
Description of the issue
RegistryManager.GetDeviceAsync (string deviceId) returns a null if device is not found.
Per Code Expected DeviceNotFoundException
Code sample exhibiting the issue
Console log of the issue
Follow the instructions here to capture SDK logs.
Don't forget to remove any connection string information!
The text was updated successfully, but these errors were encountered: