diff --git a/sample/sample6-global-middlewares/AllErrorsHandler.ts b/sample/sample6-global-middlewares/AllErrorsHandler.ts index d0e6e12a..ddb722e7 100644 --- a/sample/sample6-global-middlewares/AllErrorsHandler.ts +++ b/sample/sample6-global-middlewares/AllErrorsHandler.ts @@ -1,12 +1,12 @@ import {ExpressErrorMiddlewareInterface} from "../../src/driver/express/ExpressErrorMiddlewareInterface"; import {Middleware} from "../../src/decorator/Middleware"; -@Middleware({ type: "before" }) +@Middleware({ type: "after" }) export class AllErrorsHandler implements ExpressErrorMiddlewareInterface { - error(error: any, request: any, response: any, next?: Function): void { + error(error: any, request: any, response: any, next: Function): void { console.log("Error handled: ", error); next(error); } -} \ No newline at end of file +}