MCPcopy Create free account
hub / github.com/GoogleCloudPlatform/functions-framework-nodejs / errorHandler

Function errorHandler

src/function_wrappers.ts:106–113  ·  view source on GitHub ↗
(err: Error)

Source from the content-addressed store, hash-verified

104 return (req: Request, res: Response) => {
105 const d = domain.create();
106 const errorHandler = (err: Error) => {
107 if (res.locals.functionExecutionFinished) {
108 console.error(`Exception from a finished function: ${err}`);
109 } else {
110 res.locals.functionExecutionFinished = true;
111 sendCrashResponse({err, res});
112 }
113 };
114
115 // Catch unhandled errors originating from this request.
116 d.on('error', errorHandler);

Callers

nothing calls this directly

Calls 1

sendCrashResponseFunction · 0.90

Tested by

no test coverage detected