Share via


BatchError Class

  • java.lang.Object
    • com.azure.compute.batch.models.BatchError

Implements

public final class BatchError
implements JsonSerializable<BatchError>

An error response received from the Azure Batch service.

Method Summary

Modifier and Type Method and Description
static BatchError fromException(HttpResponseException err)

Reads an instance of BatchError from an HttpResponseException.

static BatchError fromJson(JsonReader jsonReader)

Reads an instance of BatchError from the JsonReader.

String getCode()

Get the code property: An identifier for the error.

BatchErrorMessage getMessage()

Get the message property: A message describing the error, intended to be suitable for display in a user interface.

List<BatchErrorDetail> getValues()

Get the values property: A collection of key-value pairs containing additional details about the error.

JsonWriter toJson(JsonWriter jsonWriter)

Methods inherited from java.lang.Object

Method Details

fromException

public static BatchError fromException(HttpResponseException err)

Reads an instance of BatchError from an HttpResponseException.

Parameters:

err - The HttpResponseException based exception returned from an api call.

Returns:

An instance of BatchError if the HttpResponseException containted an instance of it, or null if it was pointing to an HttpResponseException with no BatchError.

fromJson

public static BatchError fromJson(JsonReader jsonReader)

Reads an instance of BatchError from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of BatchError if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.

Throws:

IOException

- If an error occurs while reading the BatchError.

getCode

public String getCode()

Get the code property: An identifier for the error. Codes are invariant and are intended to be consumed programmatically.

Returns:

the code value.

getMessage

public BatchErrorMessage getMessage()

Get the message property: A message describing the error, intended to be suitable for display in a user interface.

Returns:

the message value.

getValues

public List<BatchErrorDetail> getValues()

Get the values property: A collection of key-value pairs containing additional details about the error.

Returns:

the values value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

Applies to