summary refs log tree commit diff
path: root/api/src/middlewares
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
commit7db26b595293e45ab0c9faa2f7e4d82173f71af3 (patch)
tree33c1c02467fa5ba796b4d2ba331482135c656cf6 /api/src/middlewares
parentadded template for future routes (diff)
downloadserver-7db26b595293e45ab0c9faa2f7e4d82173f71af3.tar.xz
moved Constants and Errorhandler from api to util
Diffstat (limited to 'api/src/middlewares')
-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();