MCPcopy Create free account
hub / github.com/CommandCodeAI/BaseAI / makeMessage

Method makeMessage

packages/core/src/common/errors.ts:33–56  ·  view source on GitHub ↗
(
		status: number | undefined,
		error: any,
		message: string | undefined,
	)

Source from the content-addressed store, hash-verified

31 }
32
33 private static makeMessage(
34 status: number | undefined,
35 error: any,
36 message: string | undefined,
37 ): string {
38 const msg = error?.message
39 ? typeof error.message === 'string'
40 ? error.message
41 : JSON.stringify(error.message)
42 : error
43 ? JSON.stringify(error)
44 : message;
45
46 if (status && msg) {
47 return `${status} ${msg}`;
48 }
49 if (status) {
50 return `${status} status code (no body)`;
51 }
52 if (msg) {
53 return msg;
54 }
55 return '(no status code or body)';
56 }
57
58 static generate(
59 status: number | undefined,

Callers 1

constructorMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected