Skip to content

Replace JSON-RPC error code literals with named constants #827

@csgui

Description

@csgui

Currently, JSON-RPC error codes such as -32600, -32601, ... are represented as numeric literals throughout the codebase. These codes are defined by the JSON-RPC 2.0 specification.

Consider introduce named constants for all standard JSON-RPC error codes, for example:

JSON_RPC_INVALID_REQUEST = -32600
JSON_RPC_METHOD_NOT_FOUND = -32601
JSON_RPC_INVALID_PARAMS = -32602
JSON_RPC_INTERNAL_ERROR = -32603
.
.
.

Checkpoints:

  • Replace all occurrences of numeric literals in the codebase with these named constants
  • Reference the JSON-RPC specification in the constant definitions
  • Tests for the implementation

Metadata

Metadata

Assignees

Labels

reliabilityRelated to runtime reliability, stability and production readiness

Type

Projects

Status

In progress

Relationships

None yet

Development

No branches or pull requests

Issue actions