| 3 | import { IDinoErrorController } from '../interfaces'; |
| 4 | |
| 5 | export 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 | } |
nothing calls this directly
no outgoing calls
no test coverage detected