1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-10 20:52:42 +01:00

fixed 'undefined not found' + error not showing in client

This commit is contained in:
xnacly 2021-09-03 20:00:19 +02:00
parent 3a3de120dc
commit 9e1aac7471

View File

@ -19,8 +19,8 @@ export function ErrorHandler(error: Error, req: Request, res: Response, next: Ne
code = error.code;
message = error.message;
httpcode = error.httpStatus;
} else if (error as EntityNotFoundError) {
message = `${(error as any).stringifyTarget} could not be found`;
} else if (error instanceof EntityNotFoundError) {
message = `${(error as any).stringifyTarget || "Item"} could not be found`;
code = 404;
} else if (error instanceof FieldError) {
code = Number(error.code);