Dela via


ErrorMessageParser Class

  • java.lang.Object
    • com.microsoft.azure.sdk.iot.deps.serializer.ErrorMessageParser

public class ErrorMessageParser

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

Constructor Summary

Constructor Description
ErrorMessageParser()

Method Summary

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

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

static java.lang.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

static int getDefaultErrorCode()

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.toString java.lang.Object.wait java.lang.Object.wait java.lang.Object.wait

Constructor Details

ErrorMessageParser

public ErrorMessageParser()

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