Class BatchError

java.lang.Object
com.azure.compute.batch.models.BatchError
All Implemented Interfaces:
com.azure.json.JsonSerializable<BatchError>

public final class BatchError extends Object implements com.azure.json.JsonSerializable<BatchError>
An error response received from the Azure Batch service.
  • Method Summary

    Modifier and Type
    Method
    Description
    static BatchError
    fromException(com.azure.core.exception.HttpResponseException err)
    Reads an instance of BatchError from an HttpResponseException.
    static BatchError
    fromJson(com.azure.json.JsonReader jsonReader)
    Reads an instance of BatchError from the JsonReader.
    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.JsonWriter
    toJson(com.azure.json.JsonWriter jsonWriter)

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.azure.json.JsonSerializable

    toJson, toJson, toJsonBytes, toJsonString
  • Method Details

    • 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 com.azure.json.JsonWriter toJson(com.azure.json.JsonWriter jsonWriter) throws IOException
      Specified by:
      toJson in interface com.azure.json.JsonSerializable<BatchError>
      Throws:
      IOException
    • fromJson

      public static BatchError fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      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

      public static BatchError fromException(com.azure.core.exception.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.