- tests/errorMessage.test.ts (new): covers both branches of errorMessage()
(Error instance → .message, non-Error → String()) and both branches of
asError() (Error passthrough, non-Error wrapping), including subclasses,
null, undefined, and numeric inputs.
- tests/RpcError.test.ts (new): covers RpcError constructor (name/code/
message/data set correctly, optional data omitted), instanceof Error,
and is() true/false branches with close numeric codes.
Also bundles isPreconditionFailed() from src/proto/rpcError.ts: all
branches tested — PreconditionFailed match, wrong code, missing code
property, null, string/number primitives, and duck-typed plain object.
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>