Skip to content

Commit

Permalink
Throw an error if we try to access a configurable parameter, but it h…
Browse files Browse the repository at this point in the history
…as not been configured yet.
  • Loading branch information
bnoguchi committed Apr 7, 2011
1 parent 7725860 commit 94aec38
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 5 additions & 1 deletion lib/everymodule.js
Expand Up @@ -68,7 +68,11 @@ var everyModule = module.exports = {
if (!this[property])
this[property] = function (setTo) {
var k = '_' + property;
if (!arguments.length) return this[k];
if (!arguments.length) {
if ('undefined' === typeof this[k])
throw new Error('You are trying to access property `' + k + '`, which you did not configure. Time to configure it.');
return this[k];
}
this[k] = setTo;
return this;
};
Expand Down
1 change: 0 additions & 1 deletion lib/password.js
Expand Up @@ -58,7 +58,6 @@ everyModule.submodule('password')
_auth.loggedIn = !!user;
})
.sendResponse( function (res, user) {
conole.log(3);
res.writeHead(303, {'Location': this.redirectPath()});
res.end();
})
Expand Down

0 comments on commit 94aec38

Please sign in to comment.