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

Method makeMessage

packages/google-calendar/src/error.ts:27–50  ·  view source on GitHub ↗
(
    status: number | undefined,
    error: any,
    message: string | undefined,
  )

Source from the content-addressed store, hash-verified

25 | undefined,
26> extends Error {
27 /** HTTP status for the response that caused the error */
28 readonly status: TStatus;
29 /** HTTP headers for the response that caused the error */
30 readonly headers: THeaders;
31 /** JSON body of the response that caused the error */
32 readonly error: TError;
33
34 constructor(
35 status: TStatus,
36 error: TError,
37 message: string | undefined,
38 headers: THeaders,
39 ) {
40 super(APIError.makeMessage(status, error, message));
41 this.status = status;
42 this.headers = headers;
43 this.error = error;
44 }
45
46 hasReason(reason: string) {
47 const errors = this.error?.error.errors;
48
49 if (!errors) {
50 return false;
51 }
52
53 return errors.some((error) => error.reason === reason);

Callers 1

constructorMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected