MCPcopy Create free account
hub / github.com/ParallelTask/dinoloop / DinoErrorController

Class DinoErrorController

src/modules/core/dino.error.controller.ts:5–26  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3import { IDinoErrorController } from '../interfaces';
4
5export class DinoErrorController implements IDinoErrorController {
6 private controller: ErrorController;
7
8 constructor(controller: ErrorController) {
9 this.controller = controller;
10 }
11
12 patch(err: Error, req: Request, res: Response, next: NextFunction): void {
13 this.controller.request = req;
14 this.controller.response = res;
15 this.controller.next = next;
16 this.controller.error = err;
17 }
18
19 invoke(actionName: string): void {
20 this.controller[actionName]();
21 }
22
23 static create(controller: ErrorController): DinoErrorController {
24 return new DinoErrorController(controller);
25 }
26}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected