1
0
mirror of https://github.com/moparisthebest/kaiwa synced 2025-02-16 07:00:09 -05:00

Prettier errors

This commit is contained in:
Carlos Brito Lage 2013-10-20 15:44:22 -07:00
parent 14b34dc289
commit 775a8d9d18
2 changed files with 14 additions and 2 deletions

View File

@ -91,7 +91,7 @@ app.get('*', clientApp.html());
app.use(function handleError(err, req, res, next) { app.use(function handleError(err, req, res, next) {
var errorResult = {message: 'something bad happened'}; var errorResult = {message: 'Something bad happened :('};
if (config.isDev) { if (config.isDev) {
if (err instanceof Error) { 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({ //https.createServer({

11
views/error.jade Normal file
View 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}