ax(node): rename pe to protocolError in GetProtocolErrorCode
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run

AX Principle 1: pe is an abbreviation requiring a comment to explain.
Renamed to protocolError throughout, including the usage example comment.

Co-Authored-By: Charon <charon@lethean.io>
This commit is contained in:
Claude 2026-04-02 16:16:44 +01:00
parent 4638a34ffa
commit cdeb66b82d
No known key found for this signature in database
GPG key ID: AF404715446AEB41

View file

@ -4,7 +4,7 @@ import (
"strconv"
)
// if pe, ok := err.(*ProtocolError); ok { log(pe.Code, pe.Message) }
// if protocolError, ok := err.(*ProtocolError); ok { log(protocolError.Code, protocolError.Message) }
type ProtocolError struct {
Code int
Message string
@ -79,8 +79,8 @@ func IsProtocolError(err error) bool {
// code := GetProtocolErrorCode(err) // 0 when err is not a ProtocolError
func GetProtocolErrorCode(err error) int {
if pe, ok := err.(*ProtocolError); ok {
return pe.Code
if protocolError, ok := err.(*ProtocolError); ok {
return protocolError.Code
}
return 0
}