IotHubException Class

  • java.lang.Object
    • Exception
      • com.microsoft.azure.sdk.iot.service.exceptions.IotHubException

public class IotHubException

Super class for IotHub exceptions

Field Summary

Modifier and Type Field and Description
int errorCode

Provides the HTTP error code, if applicable.

This value will be a 6 digital error code such as 404001 if the service provided one in response message to the HTTP request. Otherwise it will be a 3 digit status code such as 404.

For AMQP operations such as sending cloud to device messages, receiving message feedback, and getting file upload notifications, this field will not be populated.

ErrorCodeDescription errorCodeDescription

Provides the HTTP error code description, if applicable.

For AMQP operations such as sending cloud to device messages, receiving message feedback, and getting file upload notifications, this field will not be populated.

Constructor Summary

Constructor Description
IotHubException()

Instantiate a new IotHubException with no details.

IotHubException(int errorCode, String message)

Instantiate a new IotHubException.

IotHubException(String message)

Instantiate a new IotHubException.

Field Details

errorCode

protected int errorCode

Provides the HTTP error code, if applicable.

This value will be a 6 digital error code such as 404001 if the service provided one in response message to the HTTP request. Otherwise it will be a 3 digit status code such as 404.

For AMQP operations such as sending cloud to device messages, receiving message feedback, and getting file upload notifications, this field will not be populated.

errorCodeDescription

protected ErrorCodeDescription errorCodeDescription

Provides the HTTP error code description, if applicable.

For AMQP operations such as sending cloud to device messages, receiving message feedback, and getting file upload notifications, this field will not be populated.

Constructor Details

IotHubException

public IotHubException()

Instantiate a new IotHubException with no details.

IotHubException

public IotHubException(int errorCode, String message)

Instantiate a new IotHubException.

Parameters:

errorCode - the Http status code (200, 401, 404, etc.)
message - the human readable description for why this exception was thrown.

IotHubException

public IotHubException(String message)

Instantiate a new IotHubException.

Parameters:

message - the human readable description for why this exception was thrown.

Applies to