ODataError
import { ODataError } from "@skipcheck/tm1-client"; 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
code property | TM1's error code, or empty. |
message property | TM1's message, or empty. |
target property | What the error applies to, or undefined. |
details property | Further errors, or empty. |
innerError property | Server-specific details as TM1 sent them, or undefined. |
ODataError constructor | An OData error response body. |
from static | The error in a parsed JSON body, wrapped in error or not; undefined if it isn't one. |
fromText static | The error in a plain-text body, as TM1 sends some (its Error. |
parse static | The error in a response body, whatever its form. |
equals | Whether other is the same error. |
toString | The error's code and message, for logs. |
code
propertycode: stringTM1's error code, or empty.
message
propertymessage: stringTM1's message, or empty.
target
propertytarget: string | undefinedWhat the error applies to, or undefined.
details
propertydetails: readonly ODataError[]Further errors, or empty.
innerError
propertyinnerError: unknownServer-specific details as TM1 sent them, or undefined.
ODataError
constructorconstructor(code: string | null | undefined, message: string | null | undefined, target?: string, details?: readonly ODataError[], innerError?: unknown)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. A null code or message reads as empty.
from
staticstatic from(body: unknown): ODataError | undefinedThe error in a parsed JSON body, wrapped in error or not; undefined if it isn't one.
fromText
staticstatic fromText(body: string): ODataError | undefinedThe error in a plain-text body, as TM1 sends some (its Error: lines dropped, the rest joined on one line and cut at 1000 characters); undefined if there's no text.
parse
staticstatic parse(body: Uint8Array | string | null | undefined): ODataError | undefinedThe error in a response body, whatever its form: JSON, then plain text; undefined if empty.
equals
equals(other: unknown): booleanWhether other is the same error: code, message, target, details and inner error alike.
toString
toString(): stringThe error's code and message, for logs.