From: abias Date: Mon, 22 May 2023 12:38:05 +0000 (-0400) Subject: Make error code always display X-Git-Url: http://these/git/%7B?a=commitdiff_plain;h=83fc9f3949243c6a11e1538660dc07021c2d537e;p=lemmy-ui.git Make error code always display --- diff --git a/src/server/index.tsx b/src/server/index.tsx index 47262ed..85112b3 100644 --- a/src/server/index.tsx +++ b/src/server/index.tsx @@ -294,13 +294,11 @@ async function fetchIconPng(iconUrl: string) { .then(blob => blob.arrayBuffer()); } -function getErrorPageData(error: string, site?: GetSiteResponse) { +function getErrorPageData(error: Error, site?: GetSiteResponse) { const errorPageData: ErrorPageData = {}; - // Exact error should only be seen in a development environment. Users - // in production will get a more generic message. - if (process.env.NODE_ENV === "development") { - errorPageData.error = error; + if (site) { + errorPageData.error = error.message; } const adminMatrixIds = site?.admins diff --git a/src/shared/components/app/error-page.tsx b/src/shared/components/app/error-page.tsx index 243a4a4..2a6c1a1 100644 --- a/src/shared/components/app/error-page.tsx +++ b/src/shared/components/app/error-page.tsx @@ -57,12 +57,7 @@ export class ErrorPage extends Component { )} {errorPageData?.error && ( - - {errorPageData.error} - + Error Code: {errorPageData.error} )} );