jfc that was pathetic... fix error handling
parent
fb8ee6dca3
commit
eecb2b5c39
|
@ -32,7 +32,7 @@ router.get(
|
||||||
req.params.address,
|
req.params.address,
|
||||||
req.params.uid
|
req.params.uid
|
||||||
)
|
)
|
||||||
if (mail && !mail == "womp womp") {
|
if (mail && mail != "womp womp") {
|
||||||
// Emails are immutable, cache if found
|
// Emails are immutable, cache if found
|
||||||
res.set('Cache-Control', 'private, max-age=600')
|
res.set('Cache-Control', 'private, max-age=600')
|
||||||
res.render('mail', {
|
res.render('mail', {
|
||||||
|
@ -44,7 +44,10 @@ router.get(
|
||||||
madebysite: config.branding[2]
|
madebysite: config.branding[2]
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
next({message: 'This mail could not be found. It either does not exist or has been deleted from our servers!', status: 404})
|
next({
|
||||||
|
message: 'This mail could not be found. It either does not exist or has been deleted from our servers!',
|
||||||
|
status: 404
|
||||||
|
})
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('error while fetching one email', error)
|
console.error('error while fetching one email', error)
|
||||||
|
|
Loading…
Reference in New Issue