SDK errors
One error class
Every failure — a rejected request, a dropped connection, a missing path
parameter — arrives as an AegisError. There is no subclass hierarchy, so
branch on status or code.
What maps to what
A status of 0 always means the request never reached Aegis. Nothing about it
is worth retrying immediately without checking your own setup first.
The missing-path-parameter case rejects rather than throws synchronously — it happens inside the async request pipeline. Only the constructor guard throws immediately.
Reacting to specific failures
Rate limiting and player limits are the two worth special-casing, since both have a correct response other than giving up:
player_limit means the project is at its concurrent-player ceiling for the
plan — back off, or upgrade. See rate limits.
What is not an error
A 200 response carrying a failure inside the body is not raised. The binary
encode and decode endpoints do this: a decode failure comes back as
{ error: true, data: { error: '…' } }. Read data.error on those.
aegis.music.meaning behaves similarly, resolving with meaning: null when
nothing was found.
Timeout
The default timeout is 30 seconds, overridable per client with timeoutMs. A
timeout surfaces as an AegisError with status: 0. The
aegis.jobs.wait endpoint can legitimately take up to 300 seconds, so
raise timeoutMs above that if you use it.