MCPcopy
hub / github.com/vercel/chatbot / constructor

Method constructor

lib/errors.ts:41–51  ·  view source on GitHub ↗
(errorCode: ErrorCode, cause?: string)

Source from the content-addressed store, hash-verified

39 public statusCode: number;
40
41 constructor(errorCode: ErrorCode, cause?: string) {
42 super();
43
44 const [type, surface] = errorCode.split(':');
45
46 this.type = type as ErrorType;
47 this.cause = cause;
48 this.surface = surface as Surface;
49 this.message = getMessageByErrorCode(errorCode);
50 this.statusCode = getStatusCodeByType(this.type);
51 }
52
53 public toResponse() {
54 const code: ErrorCode = `${this.type}:${this.surface}`;

Callers

nothing calls this directly

Calls 2

getMessageByErrorCodeFunction · 0.85
getStatusCodeByTypeFunction · 0.85

Tested by

no test coverage detected