diff --git a/public/500.html b/public/500.html new file mode 100644 index 00000000..46defe6d --- /dev/null +++ b/public/500.html @@ -0,0 +1,202 @@ + + + + + 500 Server error + + + + + + + +
+
500
+

Sorry, it seems we did something wrong.

+

It might have been just a temporary issue, try refreshing the page or redo the action you were trying to do. If the issue occurs again, please contact us.

+ Go to homepage +
+ + + + diff --git a/server/index.js b/server/index.js index 753b16c9..c521a0b4 100644 --- a/server/index.js +++ b/server/index.js @@ -27,6 +27,7 @@ const Decimal = require('decimal.js'); const auth = require('./auth'); const renderer = require('./renderer'); const dataLoader = require('./dataLoader'); +const fs = require('fs'); const buildPath = path.resolve(__dirname, '..', 'build'); const dev = process.env.NODE_ENV !== 'production'; @@ -144,7 +145,8 @@ app.get('*', (req, res) => { }) .catch(e => { console.error(e); - res.status(500).send(e.message); + const errorPage = fs.readFileSync(path.join(buildPath, '500.html'), 'utf-8'); + res.status(500).send(errorPage); }); });