MCPcopy Create free account
hub / github.com/analogdotnow/Analog / makeMessage

Method makeMessage

packages/google-tasks/src/core/error.ts:31–54  ·  view source on GitHub ↗
(
    status: number | undefined,
    error: any,
    message: string | undefined,
  )

Source from the content-addressed store, hash-verified

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

Callers 1

constructorMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected