Skip to main content

is_modern_error_code

Function is_modern_error_code 

Source
pub fn is_modern_error_code(code: i64) -> bool
Expand description

Is code a JSON-RPC error code only a modern server emits? Used for era detection: a -32022 (UnsupportedProtocolVersion) or -32020 (HeaderMismatch) in the body of a failed modern probe identifies a modern server, so the client retries rather than falling back to initialize. Generic codes (e.g. -32601 method-not- found) are ambiguous across eras and are NOT modern-defining.