diff --git a/src/server/index.tsx b/src/server/index.tsx index e2d0c2ff..7d322580 100644 --- a/src/server/index.tsx +++ b/src/server/index.tsx @@ -46,8 +46,8 @@ server.get('/*', async (req, res) => { // Redirect to the 404 if there's an API error if (routeData[0] && routeData[0].error) { - console.log(`Route error: ${routeData[0].error}`); - return res.redirect('/404'); + let errCode = routeData[0].error; + return res.redirect(`/404?err=${errCode}`); } let acceptLang = req.headers['accept-language'] diff --git a/src/shared/components/no-match.tsx b/src/shared/components/no-match.tsx index 7020b2bd..99ea6151 100644 --- a/src/shared/components/no-match.tsx +++ b/src/shared/components/no-match.tsx @@ -1,6 +1,9 @@ import { Component } from 'inferno'; +import { i18n } from '../i18next'; export class NoMatch extends Component { + private errCode = new URLSearchParams(this.props.location.search).get('err'); + constructor(props: any, context: any) { super(props, context); } @@ -9,6 +12,11 @@ export class NoMatch extends Component { return (

404

+ {this.errCode && ( +

+ {i18n.t('code')}: {i18n.t(this.errCode)} +

+ )}
); }