Compartilhar via


IotHubException Class

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

public class IotHubException
extends java.lang.Exception

Super class for IotHub exceptions

Field Summary

Modifier and Type Field and Description
protected int errorCode

Provides the HTTP error code, if applicable.

protected ErrorCodeDescription errorCodeDescription

Provides the HTTP error code description, if applicable.

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.

Methods inherited from java.lang.Object

java.lang.Object.clone java.lang.Object.equals java.lang.Object.finalize java.lang.Object.getClass java.lang.Object.hashCode java.lang.Object.notify java.lang.Object.notifyAll java.lang.Object.wait java.lang.Object.wait java.lang.Object.wait

Methods inherited from java.lang.Throwable

java.lang.Throwable.addSuppressed java.lang.Throwable.fillInStackTrace java.lang.Throwable.getCause java.lang.Throwable.getLocalizedMessage java.lang.Throwable.getMessage java.lang.Throwable.getStackTrace java.lang.Throwable.getSuppressed java.lang.Throwable.initCause java.lang.Throwable.printStackTrace java.lang.Throwable.printStackTrace java.lang.Throwable.printStackTrace java.lang.Throwable.setStackTrace java.lang.Throwable.toString

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