Skip to content

Commit

Permalink
Better error output when using flash without session middleware.
Browse files Browse the repository at this point in the history
  • Loading branch information
masylum authored and tj committed Mar 21, 2011
1 parent b122bf2 commit be7068f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/request.js
Expand Up @@ -190,6 +190,7 @@ req.param = function(name, defaultValue){
*/

req.flash = function(type, msg){
if (this.session === undefined) throw Error('You must enable session middleware!');
var msgs = this.session.flash = this.session.flash || {};
if (type && msg) {
var i = 2
Expand Down

0 comments on commit be7068f

Please sign in to comment.