Skip to content

Commit b37eb00

Browse files
committed
Merge pull request #82 from zfarrell/partials-404
fix(node:express): return 404 status code when partial can't be found
2 parents 4542fda + afb9d37 commit b37eb00

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Diff for: templates/express/controllers/index.js

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ exports.partials = function(req, res) {
1010
var requestedView = path.join('./', stripped);
1111
res.render(requestedView, function(err, html) {
1212
if(err) {
13+
console.log("Error rendering partial '" + requestedView + "'\n", err);
14+
res.status(404);
1315
res.send(404);
1416
} else {
1517
res.send(html);

0 commit comments

Comments
 (0)