summary refs log tree commit diff
path: root/api/src/middlewares/ErrorHandler.ts
diff options
context:
space:
mode:
Diffstat (limited to 'api/src/middlewares/ErrorHandler.ts')
-rw-r--r--api/src/middlewares/ErrorHandler.ts2
1 files changed, 1 insertions, 1 deletions
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) {