You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{"Message":"{\"errorCode\":404103,\"trackingId\":\"aa761f96e9174d0e849c96a8b2e10a8c-TimeStamp:03/14/2024 09:54:49\",\"message\":\"The operation failed because the requested device isn't online or hasn't registered the direct method callback. To learn more, see https://aka.ms/iothub404103\",\"info\":{\"timeout\":\"00:00:00\"},\"timestampUtc\":\"2024-03-14T09:54:49.6536567Z\"}","ExceptionMessage":""}
Code sample exhibiting the issue
try
{
var credential = new AzureCliCredential();
var serviceClient = ServiceClient.Create($"redacted-hostname.azure-devices.net", credential);
await serviceClient.InvokeDeviceMethodAsync("YourDevice", new CloudToDeviceMethod("YourDirectMethod", TimeSpan.FromSeconds(10)));
}
catch (DeviceNotFoundException ex)
{
Console.WriteLine("Offline? " + ex.Code);
}
Console log of the issue
Offline? InvalidErrorCode
The text was updated successfully, but these errors were encountered:
Context
Description of the issue
https://github.com/Azure/azure-iot-sdk-csharp/blob/main/iothub/service/src/Common/Exceptions/ErrorCode.cs should contain a value for 404103 DeviceOffline
When invoking a direct method on an offline device. A device not found is thrown. OK
The exception.ErrorCode is InvalidErrorCode.
Whilst the json contains: errorCode: 404103
Code sample exhibiting the issue
Console log of the issue
The text was updated successfully, but these errors were encountered: