Type guard for RPCValidationError.
Checks error.name rather than instanceof because after serialization over the wire, the error is reconstructed as a plain Error with custom properties — not an actual RPCValidationError instance. Checking .name works in both cases.
error.name
instanceof
.name
Type guard for RPCValidationError.
Checks
error.namerather thaninstanceofbecause after serialization over the wire, the error is reconstructed as a plain Error with custom properties — not an actual RPCValidationError instance. Checking.nameworks in both cases.