ผูก log เมนูทะเบียนประวัติ
This commit is contained in:
parent
5643cc67c4
commit
6539804937
76 changed files with 909 additions and 431 deletions
|
|
@ -4,6 +4,12 @@ import HttpStatus from "../interfaces/http-status";
|
|||
import { ValidateError } from "tsoa";
|
||||
|
||||
function error(error: Error, _req: Request, res: Response, _next: NextFunction) {
|
||||
const logData = _req.app.locals.logData.sequence?.at(-1);
|
||||
if (logData) {
|
||||
logData.status = "error";
|
||||
logData.description = error.message;
|
||||
}
|
||||
|
||||
if (error instanceof HttpError) {
|
||||
return res.status(error.status).json({
|
||||
status: error.status,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue