Permalink
Browse files

Better error output when using flash without session middleware.

  • Loading branch information...
1 parent b122bf2 commit be7068f5693fcfa8bcfcc752947cc3d74cf26107 @masylum masylum committed with tj Mar 21, 2011
Showing with 1 addition and 0 deletions.
  1. +1 −0 lib/request.js
View
@@ -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

0 comments on commit be7068f

Please sign in to comment.