Errors
What is raised, and which failures are worth retrying.
| error | means | retry? |
|---|---|---|
| BudgetExceeded | the call would cross this session's cap | no — raise the cap |
| TenantLimited | an account limit: rate, concurrency, spend window | yes, after a wait |
| ProviderError | the model provider refused or was unreachable | sometimes — check .retryable |
| SessionGone | the machine has been released | no — start a new session |
| OpsenError | the 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.