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 static | The rules this client knows about. |
with_rule | This classifier with rule tried first. |
rules property | The rules, in the order they are tried. |
classify | Classifies an error response. |
Rule
staticRule__init__
constructor__init__(rules: list[Rule])defaults
staticdefaults() -> Tm1ErrorClassifierThe rules this client knows about.
with_rule
with_rule(rule: Rule) -> Tm1ErrorClassifierThis classifier with rule tried first.
rules
propertyrules: tuple[Rule, ...]The rules, in the order they are tried.
classify
classify(status: int, error: ODataError | None) -> Tm1ErrorKindClassifies 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.