opsen
opsen

Errors

What is raised, and which failures are worth retrying.

errormeans retry?
BudgetExceededthe call would cross this session's capno — raise the cap
TenantLimitedan account limit: rate, concurrency, spend windowyes, after a wait
ProviderErrorthe model provider refused or was unreachablesometimes — check .retryable
SessionGonethe machine has been releasedno — start a new session
OpsenErrorthe base class; carries status and detail—
from opsen_client import BudgetExceeded, TenantLimited, ProviderError

try:
    s.exec("python3 agent.py")
except BudgetExceeded:
    ...                      # the cap did its job
except (TenantLimited, ProviderError) as e:
    if e.retryable():
        ...

TenantLimited and ProviderError are separate types because they need different handling: one is your account, the other is somebody else's outage.