summary refs log tree commit diff
path: root/api/src/middlewares/ErrorHandler.ts
diff options
context:
space:
mode:
authorxnacly <matteogropp@protonmail.com>2021-09-03 21:29:17 +0200
committerxnacly <matteogropp@protonmail.com>2021-09-03 21:29:17 +0200
commit879587d62b8606ab3d57e4a7b0c484f75b64cbda (patch)
tree5f812a767e46bb4c3a57cf08fd7ff0bf26746b5b /api/src/middlewares/ErrorHandler.ts
parentadded template for future routes (diff)
downloadserver-879587d62b8606ab3d57e4a7b0c484f75b64cbda.tar.xz
moved Constants and Errorhandler from api to util
Diffstat (limited to 'api/src/middlewares/ErrorHandler.ts')
-rw-r--r--api/src/middlewares/ErrorHandler.ts3
1 files changed, 1 insertions, 2 deletions
diff --git a/api/src/middlewares/ErrorHandler.ts b/api/src/middlewares/ErrorHandler.ts

index d8e44bd7..be2586cf 100644 --- a/api/src/middlewares/ErrorHandler.ts +++ b/api/src/middlewares/ErrorHandler.ts
@@ -2,9 +2,8 @@ import { NextFunction, Request, Response } from "express"; import { HTTPError } from "lambert-server"; import { EntityNotFoundError } from "typeorm"; import { FieldError } from "../util/instanceOf"; -import { ApiError } from "../util/ApiError"; +import { ApiError } from "@fosscord/util"; -// TODO: update with new body/typorm validation export function ErrorHandler(error: Error, req: Request, res: Response, next: NextFunction) { if (!error) return next();