diff options
author | xnacly <matteogropp@protonmail.com> | 2021-09-03 21:29:17 +0200 |
---|---|---|
committer | xnacly <matteogropp@protonmail.com> | 2021-09-03 21:29:17 +0200 |
commit | 879587d62b8606ab3d57e4a7b0c484f75b64cbda (patch) | |
tree | 5f812a767e46bb4c3a57cf08fd7ff0bf26746b5b /api/src/middlewares | |
parent | added template for future routes (diff) | |
download | server-879587d62b8606ab3d57e4a7b0c484f75b64cbda.tar.xz |
moved Constants and Errorhandler from api to util
Diffstat (limited to 'api/src/middlewares')
-rw-r--r-- | api/src/middlewares/ErrorHandler.ts | 3 |
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(); |