File size: 386 Bytes
548a458
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
export type ToolErrorCode =
  | "UNKNOWN_SESSION"
  | "INVALID_INPUT"
  | "QUOTA_EXCEEDED"
  | "RATE_LIMITED"
  | "HARD_TIMEOUT"
  | "SESSION_INVALID"
  | "INTERNAL"
  | "NOT_FOUND";

export class ToolError extends Error {
  readonly code: ToolErrorCode;
  constructor(code: ToolErrorCode, message: string) {
    super(message);
    this.code = code;
    this.name = "ToolError";
  }
}