Created the error util
This commit is contained in:
parent
4b9521a75f
commit
f237a5f5a0
4
src/utils/error.ts
Normal file
4
src/utils/error.ts
Normal file
@ -0,0 +1,4 @@
|
||||
import {Response} from "express";
|
||||
|
||||
export const sendError = (res: Response, httpCode: number, errorCode: number, message: string, fieldName?: string) =>
|
||||
res.status(httpCode).json({code: errorCode, message, fieldName});
|
Loading…
x
Reference in New Issue
Block a user