Skip to content

Commit

Permalink
Merge pull request #6 from m0ppers/master
Browse files Browse the repository at this point in the history
Throw proper error messages
  • Loading branch information
odogono committed Mar 18, 2013
2 parents 0f24627 + 26b589a commit 8281351
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/connect-session-file.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ var FileSessionStore = module.exports = function FileSessionStore(opts) {

// define default session store directory
this.prefix = opts.prefix || 'file-store-';
this.path = process.env.TMPDIR || process.env.TEMP;
// ensure specified path exists (create if neccesary)
if( opts.path && fs.existsSync(opts.path) ){
this.path = opts.path;
this.path = opts.path || process.env.TMPDIR || process.env.TEMP;
// ensure specified path exists
if (!fs.existsSync(this.path)) {
throw new Error('Path ' + this.path + ' does not exist!');
}
this.useAsync = opts.useAsync;
this.printDebug = opts.printDebug;
Expand Down

0 comments on commit 8281351

Please sign in to comment.