Skip to content

Commit 66c5c44

Browse files
authored
Update part4d.md
error code corrected and changed error message to match line 230
1 parent 0d6872c commit 66c5c44

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/content/4/en/part4d.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ const errorHandler = (error, request, response, next) => {
227227
} else if (error.name === 'MongoServerError' && error.message.includes('E11000 duplicate key error')) {
228228
return response.status(400).json({ error: 'expected `username` to be unique' })
229229
} else if (error.name === 'JsonWebTokenError') { // highlight-line
230-
return response.status(400).json({ error: 'token missing or invalid' }) // highlight-line
230+
return response.status(401).json({ error: 'token invalid' }) // highlight-line
231231
}
232232

233233
next(error)

0 commit comments

Comments
 (0)