Skip to content

Commit

Permalink
Updating exception details for IotHubThrottledException (#2088)
Browse files Browse the repository at this point in the history
  • Loading branch information
vinagesh authored and David R. Williamson committed Jul 16, 2021
1 parent 07b77d7 commit 173c185
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 11 deletions.
2 changes: 1 addition & 1 deletion e2e/test/prerequisites/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ docker run -d --restart unless-stopped --name azure-iot-tpmsim -p 127.0.0.1:2321

Alternatives:

- Stand-alone executable for Windows: https://www.microsoft.com/en-us/download/details.aspx?id=52507
- Stand-alone executable for Windows: https://www.microsoft.com/download/details.aspx?id=52507

### Proxy Server

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace Microsoft.Azure.Devices.Client.Exceptions
{
/// <summary>
/// This exception actually corresponds to IoTHubQuotaExceeded. For more information on what causes this error
/// and steps to resolve, see <see href="https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-troubleshoot-error-403002-iothubquotaexceeded"/>.
/// and steps to resolve, see <see href="https://docs.microsoft.com/azure/iot-hub/iot-hub-troubleshoot-error-403002-iothubquotaexceeded"/>.
/// The exception type has not been changed to avoid breaking changes but the inner exception has the correct exception type.
/// </summary>
[Serializable]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ namespace Microsoft.Azure.Devices.Client.Exceptions
/// <remarks>
/// An abandoned message will be re-enqueued in the per-device/module queue, and the <see cref="DeviceClient"/> instance will receive it again.
/// A rejected message will be deleted from the queue and not received again by the device.
/// For more information on the cause for this error and how to resolve, see <see href="https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-troubleshoot-error-412002-devicemessagelocklost"/>.
/// For more information on cloud-to-device message lifecycle, see <see href="https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-devguide-messages-c2d#the-cloud-to-device-message-life-cycle"/>.
/// For more information on the cause for this error and how to resolve, see <see href="https://docs.microsoft.com/azure/iot-hub/iot-hub-troubleshoot-error-412002-devicemessagelocklost"/>.
/// For more information on cloud-to-device message lifecycle, see <see href="https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messages-c2d#the-cloud-to-device-message-life-cycle"/>.
/// </remarks>
[Serializable]
public class DeviceMessageLockLostException : IotHubException
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@
namespace Microsoft.Azure.Devices.Client.Exceptions
{
/// <summary>
/// The exception that is thrown when the service requires exponential back-off because it has exceeded the maximum number of allowed active requests.
/// This exception is thrown when the requests to the IoT hub exceed the limits based on the tier of the hub.
/// Retrying with exponential back-off could resolve this error.
/// </summary>
/// <remarks>
/// For information on the IoT hub quotas and throttling, see <see href="https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-quotas-throttling"/>.
/// </remarks>
[Serializable]
public sealed class IotHubThrottledException : IotHubException
{
Expand Down
4 changes: 2 additions & 2 deletions iothub/device/src/Transport/AmqpIot/AmqpIotErrorAdapter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,8 @@ public static Exception ToIotHubClientContract(Error error)
else if (error.Condition.Equals(AmqpErrorCode.ResourceLimitExceeded))
{
// Note: The DeviceMaximumQueueDepthExceededException is not supposed to be thrown here as it is being mapped to the incorrect error code
// Error code 403004 is only applicable to C2D (Service client); see https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-troubleshoot-error-403004-devicemaximumqueuedepthexceeded
// Error code 403002 is applicable to D2C (Device client); see https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-troubleshoot-error-403002-iothubquotaexceeded
// Error code 403004 is only applicable to C2D (Service client); see https://docs.microsoft.com/azure/iot-hub/iot-hub-troubleshoot-error-403004-devicemaximumqueuedepthexceeded
// Error code 403002 is applicable to D2C (Device client); see https://docs.microsoft.com/azure/iot-hub/iot-hub-troubleshoot-error-403002-iothubquotaexceeded
// We have opted not to change the exception type thrown here since it will be a breaking change, alternatively, we are adding the correct exception type
// as the inner exception.
retException = new DeviceMaximumQueueDepthExceededException(
Expand Down
6 changes: 3 additions & 3 deletions iothub/service/src/Common/Exceptions/ErrorCode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -216,19 +216,19 @@ public enum ErrorCode

/// <summary>
/// IoT hub throttling limits have been exceeded for the requested operation.
/// For more information, <see href="https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-devguide-quotas-throttling">IoT Hub quotas and throttling</see>.
/// For more information, <see href="https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-quotas-throttling">IoT Hub quotas and throttling</see>.
/// </summary>
ThrottlingException = 429001,

/// <summary>
/// IoT hub throttling limits have been exceeded for the requested operation.
/// For more information, <see href="https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-devguide-quotas-throttling">IoT Hub quotas and throttling</see>.
/// For more information, <see href="https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-quotas-throttling">IoT Hub quotas and throttling</see>.
/// </summary>
ThrottleBacklogLimitExceeded = 429002,

/// <summary>
/// IoT hub ran into a server side issue when attempting to throttle.
/// For more information, <see href="https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-troubleshoot-error-500xxx-internal-errors">500xxx Internal errors</see>.
/// For more information, <see href="https://docs.microsoft.com/azure/iot-hub/iot-hub-troubleshoot-error-500xxx-internal-errors">500xxx Internal errors</see>.
/// </summary>
[Obsolete("This error does not appear to be returned by the service.")]
[EditorBrowsable(EditorBrowsableState.Never)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@
namespace Microsoft.Azure.Devices.Common.Exceptions
{
/// <summary>
/// The exception that is thrown when the rate of incoming requests exceeds the throttling limit set by IoT Hub.
/// This exception is thrown when the requests to the IoT hub exceed the limits based on the tier of the hub.
/// Retrying with exponential back-off could resolve this error.
/// </summary>
/// <remarks>
/// For information on the IoT hub quotas and throttling, see <see href="https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-quotas-throttling"/>.
/// </remarks>
[Serializable]
public sealed class IotHubThrottledException : IotHubException
{
Expand Down

0 comments on commit 173c185

Please sign in to comment.