Skip to content

Commit 91280b1

Browse files
author
codingChewie
committed
Handling Errors in an Express App
1 parent bae5e8e commit 91280b1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ app.use(cookieParser())
1010
app.set('view engine', 'pug')
1111

1212
app.use((req, res, next) => {
13-
req.message = 'message made it'
14-
next()
13+
const err = new Error('Oh no')
14+
next(err)
1515
})
1616

1717
app.use((req, res, next) => {

0 commit comments

Comments
 (0)