Error codes
Error code groups and usage conventions for gResultCode.
Stable error codes are defined in src/errors.ts. 0 always means success. Negative values are grouped by domain:
| Range | Domain |
|---|---|
-1 to -99 | General errors |
-100 to -199 | Networking |
-200 to -299 | Infrastructure |
-300 to -399 | |
-1000 to -1199 | User authentication and accounts |
-2000 to -2099 | Rate limiting and risk controls |
-3000 to -3299 | OAuth clients and the OAuth 2.0 server |
-4000 to -4099 | SaaS configuration and runtime errors |
-5000 to -5099 | Payments |
-6000 to -6099 | Account settings and security operations |
-7000 to -7099 | Support tickets |
-8000 to -8099 | List queries |
-9000 to -9099 | Analytics |
-10000 to -10099 | Template publishing |
-11000 to -11099 | Newsletter |
-12000 to -12099 | Affiliate program |
-13000 to -13099 | In-app notifications |
These are the error code groups defined in the source code. A group does not necessarily correspond to an available API. For example, retaining error codes for template publishing does not mean that an initialized project provides a template distribution endpoint.
Error codes identify causes that software can act on, HTTP status codes describe transport outcomes, and localized error keys provide user-facing messages. These serve distinct purposes and cannot replace one another. Add new error codes without reusing a published value for a different meaning.