ExceptionExtensions.CheckIotHubErrorCode(Exception, ErrorCode[]) Method

Definition

Indicates if the supplied exception is an IoT hub exception and its error code belongs to the supplied error code list.

public static bool CheckIotHubErrorCode (this Exception ex, params Microsoft.Azure.Devices.Common.Exceptions.ErrorCode[] errorCodeList);
static member CheckIotHubErrorCode : Exception * Microsoft.Azure.Devices.Common.Exceptions.ErrorCode[] -> bool
<Extension()>
Public Function CheckIotHubErrorCode (ex As Exception, ParamArray errorCodeList As ErrorCode()) As Boolean

Parameters

ex
Exception

The exception to test.

errorCodeList
ErrorCode[]

The list containing possible error codes.

Returns

True if the exception is an IoT hub exception, and its error code is present in the supplied error code list; otherwise, false.

Applies to