mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-01 21:31:36 +02:00
Merge pull request #2988 from overleaf/msm-oerror-remove-not-found-error
Replace HTTPErrors.NotFoundError with calls to notFound() handler GitOrigin-RevId: c98582a5bd3d862b3c17fb03d863c75f64851aba
This commit is contained in:
@@ -39,6 +39,18 @@ module.exports = {
|
||||
}
|
||||
},
|
||||
|
||||
notFound(req, res, message = 'not found', info = {}) {
|
||||
res.status(404)
|
||||
switch (req.accepts(['html', 'json'])) {
|
||||
case 'html':
|
||||
return res.render('general/404', { title: 'page_not_found' })
|
||||
case 'json':
|
||||
return renderJSONError(res, message, info)
|
||||
default:
|
||||
return res.send('not found')
|
||||
}
|
||||
},
|
||||
|
||||
unprocessableEntity(req, res, message = 'unprocessable entity', info = {}) {
|
||||
res.status(422)
|
||||
switch (req.accepts(['html', 'json'])) {
|
||||
|
||||
Reference in New Issue
Block a user