RequestError for any non-2xx response, so you handle
failures with try/catch rather than inspecting each result. On success, a
method resolves with its typed payload.
RequestError exposes:
code— a stableApiErrorCode(e.g.INVALID_REQUEST,INSUFFICIENT_BALANCE,NOT_FOUND), so you can branch on an enum instead of parsing strings. It isundefinedfor errors raised before a handler runs.status— the HTTP status code.message— a human-readable explanation.
RequestError with status 403 and no code — check status
in that case.