[Upd] User states
This commit is contained in:
parent
d07202386f
commit
ec019a4dff
16 changed files with 667 additions and 87 deletions
25
packages/shared/src/errors.ts
Normal file
25
packages/shared/src/errors.ts
Normal 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;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue