[Upd] User states

This commit is contained in:
Alex 2026-08-07 23:05:26 +02:00
commit ec019a4dff
Signed by: alex
SSH key fingerprint: SHA256:D1+Ub8o0v4K5y1JNivW8IxEOelqLSvPmUzBbDIoZkRQ
16 changed files with 667 additions and 87 deletions

View file

@ -0,0 +1,25 @@
export class ProtocolError extends Error {
readonly type: string;
readonly id: number | undefined;
readonly communicationType: string;
readonly requestId: number | undefined;
readonly errorType: string | undefined;
constructor(options: {
type: string;
requestId?: number;
errorType?: string;
}) {
super(
options.errorType
? `${options.type}: ${options.errorType}`
: options.type,
);
this.name = "ProtocolError";
this.type = options.type;
this.id = options.requestId;
this.communicationType = options.type;
this.requestId = options.requestId;
this.errorType = options.errorType;
}
}