Merge branch 'master' into Issue_1958

This commit is contained in:
David Bolack authored and GitHub committed 2024-01-25 00:18:47 -06:00
commit 8656feba44
24 files changed
+15980 -15634

No files matched your search

+10 -1
View File
@@ -476,9 +476,18 @@ const getPureError = (error)=>{
};
app.use(async (err, req, res, next)=>{
const status = err.status || err.code || 500;
err.originalUrl = req.originalUrl;
console.error(err);
if(err.originalUrl?.startsWith('/api/')) {
// console.log('API error');
res.status(err.status || err.response?.status || 500).send(err);
return;
}
// console.log('non-API error');
const status = err.status || err.code || 500;
req.ogMeta = { ...defaultMetaTags,
title : 'Error Page',
description : 'Something went wrong!'