diff --git a/server/lib/misc/ErrorHandler.ts b/server/lib/misc/ErrorHandler.ts index c55fedd1a..afb927bf9 100644 --- a/server/lib/misc/ErrorHandler.ts +++ b/server/lib/misc/ErrorHandler.ts @@ -1,20 +1,10 @@ -import path from 'path'; -import fs from 'fs'; - import * as Sentry from '@sentry/node'; import express from 'express'; -import { TEMPLATE_DIR } from '../constants'; - -const errorPage = fs - .readFileSync(path.join(TEMPLATE_DIR, 'error-message.html')) - .toString(); - export default function ErrorHandler(res: express.Response, err: Error) { if (process.env.NODE_ENV === 'production') { Sentry.captureException(err); } - res.set('Content-Type', 'text/html'); - const info = errorPage.replace('{err.message}', err.message); - res.status(400).send(info); + res.set('Content-Type', 'text/plain'); + res.status(400).send(err.message); } diff --git a/server/templates/error-message.html b/server/templates/error-message.html deleted file mode 100644 index 959ed7f68..000000000 --- a/server/templates/error-message.html +++ /dev/null @@ -1,3 +0,0 @@ -