-
Notifications
You must be signed in to change notification settings - Fork 12
/
error_handler.js
31 lines (29 loc) · 1.03 KB
/
error_handler.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
const { APP_NAME, ASSETS_URL, WWW_DOMAIN } = process.env
module.exports = (htmlHead) => {
return function errorHandler(error, req, res, next) { // eslint-disable-line no-unused-vars
console.error(error)
res.status(500).send(`
<!DOCTYPE html>
<html>
<head>
${htmlHead ? htmlHead({}) : ''}
</head>
<body>
<div id="hyperloop_application">
<div class="hero">
<div class="hero-body has-text-centered">
<div class="container">
<a href="/">
<img src=${`${ASSETS_URL}/unitedvote_mark.png`} alt="${APP_NAME}" width="45" height="45" />
</a>
<h1 class="title">We are experiencing technical difficulties</h1>
<h2 class="subtitle">Please contact <a href="${`mailto:support@${WWW_DOMAIN}`}">support@${WWW_DOMAIN}</a> if the problem persists</h2>
</div>
</div>
</div>
</div>
</body>
</html>
`)
}
}