Core concepts
Error Handling
How errors are handled in Plasma
Every method returns a readonly [Error, null] | readonly [null, T] tuple.
const [, ] = await .('get-users')
if () return ()
// data is fully typed and non-null here
.()Errors are returned (not thrown) for:
- Network failures
- Non-2xx HTTP responses
- JSON parse failures
apiPayloadZod validation failures
Errors are thrown for:
- Missing
serverUrl - Missing
Authorizationheader on a protected route