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:

RangeDomain
-1 to -99General errors
-100 to -199Networking
-200 to -299Infrastructure
-300 to -399Email
-1000 to -1199User authentication and accounts
-2000 to -2099Rate limiting and risk controls
-3000 to -3299OAuth clients and the OAuth 2.0 server
-4000 to -4099SaaS configuration and runtime errors
-5000 to -5099Payments
-6000 to -6099Account settings and security operations
-7000 to -7099Support tickets
-8000 to -8099List queries
-9000 to -9099Analytics
-10000 to -10099Template publishing
-11000 to -11099Newsletter
-12000 to -12099Affiliate program
-13000 to -13099In-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.