mirror of
https://gitlab.com/wgp/dougal/software.git
synced 2025-12-06 07:37:08 +00:00
Send specific error message if HTML template not found
This commit is contained in:
@@ -16,7 +16,11 @@ const html = async function (req, res, next) {
|
||||
res.status(200).send(response);
|
||||
next();
|
||||
} catch (err) {
|
||||
next(err);
|
||||
if (err.message.startsWith("template")) {
|
||||
next({message: err.message});
|
||||
} else {
|
||||
next(err);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user