skipcheck

TM1 client · Docs · Errors

Tm1ErrorClassifier

from skipcheck_tm1 import Tm1ErrorClassifier

Works out a Tm1ErrorKind from an error response.

TM1's error codes rarely say what went wrong: code 278 covers most failures. So classification is a table of rules, tried in order, matching on HTTP status, code and message. The first match wins, and the HTTP status decides when nothing matches. Matching on message text is a last resort, but TM1 gives nothing better for several errors (impersonation failures, for instance).

The table is data: defaults holds the rules this client knows, and with_rule adds your own in front of them, e.g. for a message your TM1 version phrases differently.

Members

Rule static
__init__ constructor
defaults staticThe rules this client knows about.
with_ruleThis classifier with rule tried first.
rules propertyThe rules, in the order they are tried.
classifyClassifies an error response.

Rule

static
Rule

__init__

constructor
__init__(rules: list[Rule])

defaults

static
defaults() -> Tm1ErrorClassifier

The rules this client knows about.

with_rule

with_rule(rule: Rule) -> Tm1ErrorClassifier

This classifier with rule tried first.

rules

property
rules: tuple[Rule, ...]

The rules, in the order they are tried.

classify

classify(status: int, error: ODataError | None) -> Tm1ErrorKind

Classifies an error response: the first matching rule's kind, or else the kind for the status. error may be None if the body wasn't an OData error.