Skip to content

Commit e7ce40e

Browse files
author
Martin Martinez Rivera
committed
Refactored code to use noErrorPage option directly instead of customPageErrors
1 parent 672e8ef commit e7ce40e

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

‎lib/handlers/error.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ var fs = require('fs');
55

66
function errorPageHandler(err, req, res, next) {
77
var ldp = req.app.locals.ldp;
8-
if (ldp.customErrorPages) {
8+
if (!ldp.noErrorPages) {
99
var errorPage = ldp.errorPages +
1010
err.status.toString() + '.html';
1111
fs.readFile(errorPage, 'utf8', function(readErr, text) {

‎lib/ldp.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ function LDP(argv) {
6262
ldp.subscriptions = {};
6363

6464
// Error pages folder
65-
ldp.customErrorPages = !argv.noErrorPages;
66-
if (ldp.customErrorPages) {
65+
ldp.noErrorPages = argv.noErrorPages;
66+
if (!ldp.noErrorPages) {
6767
ldp.errorPages = argv.errorPages || ldp.root + 'errorPages/';
6868
if (!S(ldp.errorPages).endsWith('/')) {
6969
ldp.errorPages += '/';

0 commit comments

Comments
 (0)