skipcheck

TM1 client · Docs · Errors

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 constructorReplaces a null code or message with an empty string and copies the details.
from staticReads an error from a response body, if it is one.
fromText staticReads 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

constructor
ODataError(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

static
static 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 null if the body isn't an object with a code or message

fromText

static
static 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 null if 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.