ODataError
import io.skipcheck.tm1.client.error.ODataError; An OData error response body: {"error":{"code":"278","message":"..."}}.
TM1 uses code 278 for most errors (not found, bad request, precondition failed
and not implemented alike), so the code alone rarely identifies an error. See
Tm1ErrorClassifier.
Members
ODataError constructor | Replaces a null code or message with an empty string and copies the details. |
from static | Reads an error from a response body, if it is one. |
fromText static | Reads an error from a plain-text body, as TM1 sends for some failures (impersonation, for one). |
toString | |
hashCode | |
equals | |
code | |
message | |
target | |
details | |
innerError |
ODataError
constructorODataError(String code, String message, String target, List<ODataError> details, JsonNode innerError) Replaces a null code or message with an empty string and copies the
details.
from
staticstatic ODataError from(JsonNode body) Reads an error from a response body, if it is one: either {"error":{...}}
or the inner object.
Parameters
body- a response body, or
null
Returns
- the error, or
nullif the body isn't an object with acodeormessage
fromText
staticstatic ODataError fromText(String body) Reads an error from a plain-text body, as TM1 sends for some failures
(impersonation, for one): a status line such as Error: Bad Request, then
the message. The status line is dropped, and the remaining lines become the
message, with no code.
Parameters
body- the response body as text
Returns
- the error, or
nullif the body has no message
toString
String toString()hashCode
int hashCode()equals
boolean equals(Object o)code
String code()message
String message()target
String target()details
List<ODataError> details()innerError
JsonNode innerError()Also in the Javadoc.