kimi-code / packages /klient /src /core /errors.ts
SaylorTwift's picture
SaylorTwift HF Staff
Add files using upload-large-folder tool
4e23b01 verified
Raw
History Blame Contribute Delete
438 Bytes
/**
* Client-side RPC error surfaced when the wire envelope carries a non-zero
* `code`. Mirrors the server envelope (`{ code, msg, data, request_id }`) — the
* numeric `code` is the stable branch key across the wire, not `instanceof`.
*/
export class RPCError extends Error {
constructor(
readonly code: number,
message: string,
readonly details?: unknown,
) {
super(message);
this.name = 'RPCError';
}
}