Package com.azure.compute.batch.models
Class BatchError
java.lang.Object
com.azure.compute.batch.models.BatchError
- All Implemented Interfaces:
com.azure.json.JsonSerializable<BatchError>
An error response received from the Azure Batch service.
-
Method Summary
Modifier and TypeMethodDescriptionstatic BatchErrorfromException(com.azure.core.exception.HttpResponseException err) Reads an instance of BatchError from an HttpResponseException.static BatchErrorfromJson(com.azure.json.JsonReader jsonReader) Reads an instance of BatchError from the JsonReader.getCode()Get the code property: An identifier for the error.Get the message property: A message describing the error, intended to be suitable for display in a user interface.Get the values property: A collection of key-value pairs containing additional details about the error.com.azure.json.JsonWritertoJson(com.azure.json.JsonWriter jsonWriter) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.azure.json.JsonSerializable
toJson, toJson, toJsonBytes, toJsonString
-
Method Details
-
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
Get the message property: A message describing the error, intended to be suitable for display in a user interface.- Returns:
- the message value.
-
getValues
Get the values property: A collection of key-value pairs containing additional details about the error.- Returns:
- the values value.
-
toJson
- Specified by:
toJsonin interfacecom.azure.json.JsonSerializable<BatchError>- Throws:
IOException
-
fromJson
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:
IllegalStateException- If the deserialized JSON object was missing any required properties.IOException- If an error occurs while reading the BatchError.
-
fromException
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.
-