From 0ef9af4a68ff2a7f644ddcbdccb9db27e9e28785 Mon Sep 17 00:00:00 2001 From: Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> Date: Sat, 4 Sep 2021 11:23:12 +0200 Subject: :bug: fix error handler and asset router --- api/src/middlewares/ErrorHandler.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'api') diff --git a/api/src/middlewares/ErrorHandler.ts b/api/src/middlewares/ErrorHandler.ts index 34827cab..179c5991 100644 --- a/api/src/middlewares/ErrorHandler.ts +++ b/api/src/middlewares/ErrorHandler.ts @@ -19,7 +19,7 @@ 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) { + } else if (error instanceof EntityNotFoundError) { message = `${(error as any).stringifyTarget} could not be found`; code = 404; } else if (error instanceof FieldError) { -- cgit 1.4.1