mirror of
https://github.com/moparisthebest/kaiwa
synced 2024-11-21 16:55:10 -05:00
Prettier errors
This commit is contained in:
parent
14b34dc289
commit
775a8d9d18
@ -91,7 +91,7 @@ app.get('*', clientApp.html());
|
||||
|
||||
|
||||
app.use(function handleError(err, req, res, next) {
|
||||
var errorResult = {message: 'something bad happened'};
|
||||
var errorResult = {message: 'Something bad happened :('};
|
||||
|
||||
if (config.isDev) {
|
||||
if (err instanceof Error) {
|
||||
@ -105,7 +105,8 @@ app.use(function handleError(err, req, res, next) {
|
||||
}
|
||||
}
|
||||
|
||||
return res.send(500, errorResult);
|
||||
res.status(500);
|
||||
res.render('error', errorResult);
|
||||
});
|
||||
|
||||
//https.createServer({
|
||||
|
11
views/error.jade
Normal file
11
views/error.jade
Normal file
@ -0,0 +1,11 @@
|
||||
extends layout
|
||||
|
||||
block content
|
||||
section#errorBox.content.box
|
||||
.head
|
||||
h2 Oops, something went wrong!
|
||||
|
||||
.content
|
||||
p #{message}
|
||||
if stack
|
||||
pre #{stack}
|
Loading…
Reference in New Issue
Block a user