ErrorMessageParser Class

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

public class ErrorMessageParser

Representation of a single error message collection with a Json deserializer.

Method Summary

Modifier and Type Method and Description
int bestErrorCode(String fullErrorMessage)

Get the fully qualified error code from the http response message errorReason, if one exists.

String bestErrorMessage(String fullErrorMessage)

Parse the fullErrorMessage from the IoTHub to find the root cause of the problem, after that, return a string with the best information about the issue

int getDefaultErrorCode()

Method Details

bestErrorCode

public static int bestErrorCode(String fullErrorMessage)

Get the fully qualified error code from the http response message errorReason, if one exists.

Parameters:

fullErrorMessage - the http response message error reason

Returns:

the fully qualified error code, or 0 if no error code was provided.

bestErrorMessage

public static String bestErrorMessage(String fullErrorMessage)

Parse the fullErrorMessage from the IoTHub to find the root cause of the problem, after that, return a string with the best information about the issue

Parameters:

fullErrorMessage - is the full error message from the IoTHub

Returns:

a String with the best information extracted from the error message

getDefaultErrorCode

public static int getDefaultErrorCode()

Applies to