Package com.azure.core.models
Class ResponseError
java.lang.Object
com.azure.core.models.ResponseError
- All Implemented Interfaces:
com.azure.json.JsonSerializable<ResponseError>
public final class ResponseError
extends Object
implements com.azure.json.JsonSerializable<ResponseError>
Represents the error details of an HTTP response.
This class encapsulates the details of an HTTP error response, including the error code, message, target, inner error, and additional error details. It provides methods to access these properties.
This class also provides a toJson(JsonWriter) method to serialize the error details to JSON, and
a fromJson(JsonReader) method to deserialize the error details from JSON.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionResponseError(String code, String message) Creates an instance ofResponseError. -
Method Summary
Modifier and TypeMethodDescriptionstatic ResponseErrorfromJson(com.azure.json.JsonReader jsonReader) Reads a JSON stream into aResponseError.getCode()Returns the error code of this error.Returns the error message of this 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
-
Constructor Details
-
ResponseError
Creates an instance ofResponseError.- Parameters:
code- the error code of this error.message- the error message of this error.
-
-
Method Details
-
getCode
Returns the error code of this error.- Returns:
- the error code of this error.
-
getMessage
Returns the error message of this error.- Returns:
- the error message of this error.
-
toJson
- Specified by:
toJsonin interfacecom.azure.json.JsonSerializable<ResponseError>- Throws:
IOException
-
fromJson
Reads a JSON stream into aResponseError.- Parameters:
jsonReader- TheJsonReaderbeing read.- Returns:
- The
ResponseErrorthat the JSON stream represented, or null if it pointed to JSON null. - Throws:
IllegalStateException- If the deserialized JSON object was missing any required properties.IOException- If aResponseErrorfails to be read from thejsonReader.
-