Loading
Loading
Pedagogical exception messages, an explicit retry policy, and zero shadowing of Python builtins.
AtlasoError # catch-all
├── ConfigurationError # bad construction / call inputs
│ ├── ConfigValidationError # construction-time
│ └── InputValidationError # call-time
│ └── MissingContradictsError # .candidate_parents
├── AuthenticationError # HTTP 401 (who you are)
├── TransportError # network / HTTP base
│ ├── ConnectError # DNS / TCP / TLS — RETRIED
│ ├── RequestTimeoutError # RETRIED
│ └── APIStatusError # .status_code, .response, .request_id
│ ├── PermissionDeniedError # 401 / 403 — NOT retried
│ ├── NotFoundError # 404 — NOT retried
│ ├── RateLimitError # 429 — .retry_after — RETRIED
│ └── ServerError # 5xx — RETRIED
├── FieldError # gate / invariant base
│ └── DepositRejectedError # .gate_reason
└── IdempotencyKeyConflict # .idempotency_key, .existing_idValidation errors list every valid option and point at the right method when applicable. The error is the documentation.
from atlaso import InputValidationError
try:
user.add("hello", polarity="strong")
except InputValidationError as e:
print(e)
# polarity must be one of:
# "positive" — claim that X works / is true
# "negative" — claim that X doesn't work / failed
# "cautionary" — claim with caveats
# "open" — note or open questionThe HTTP client retries transient failures up to max_retries times with exponential backoff. Retried:
ConnectError — DNS, TCP, TLS failuresRequestTimeoutErrorRateLimitError — respects Retry-After headerServerError — 5xxNot retried (would be silently destructive):
PermissionDeniedError — 401 / 403NotFoundError — 404AuthenticationError — wrong API keyInputValidationError, DepositRejectedError, IdempotencyKeyConflict — caller bugsfrom atlaso import (
APIStatusError, RateLimitError,
DepositRejectedError, IdempotencyKeyConflict, MissingContradictsError,
)
try:
user.add(...)
except DepositRejectedError as e:
print(e.gate_reason) # human-readable rule trace
try:
user.add_many(items, ...)
except IdempotencyKeyConflict as e:
print(e.idempotency_key, "already mapped to", e.existing_id)
try:
user.contradict(text, contradicts=[], reason="…")
except InputValidationError as e:
# Memory.contradict() validates non-empty contradicts at call-time.
# MissingContradictsError fires from deeper code paths where the gate
# has identified candidate parents you should consider.
print(e)
try:
...
except RateLimitError as e:
sleep(e.retry_after or 1.0)
try:
...
except APIStatusError as e:
print(e.status_code, e.request_id, e.response)Was this page helpful?