moved Constants and Errorhandler from api to util

This commit is contained in:
xnacly
2021-09-03 21:29:17 +02:00
parent afff55cb59
commit 7db26b5952
11 changed files with 104 additions and 48 deletions
+1 -2
View File
@@ -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();