Skip to content
This repository has been archived by the owner on Jan 24, 2025. It is now read-only.

Should be able to create a FileCookieStore with a non-existent file #2

Open
nylen opened this issue Oct 24, 2014 · 0 comments · May be fixed by #4
Open

Should be able to create a FileCookieStore with a non-existent file #2

nylen opened this issue Oct 24, 2014 · 0 comments · May be fixed by #4

Comments

@nylen
Copy link

nylen commented Oct 24, 2014

This currently throws an exception, and it shouldn't:

var store = new FileCookieStore('does-not-exist.json');

The error:

fs.js:432
  return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
                 ^
Error: ENOENT, no such file or directory '/node/request-test/does-not-exist.json'
    at Object.fs.openSync (fs.js:432:18)
    at Object.fs.readFileSync (fs.js:289:15)
    at loadFromFile (/node/request-test/node_modules/tough-cookie-filestore/lib/filestore.js:147:19)
    at new FileCookieStore (/node/request-test/node_modules/tough-cookie-filestore/lib/filestore.js:14:5)
    at Object.<anonymous> (/node/request-test/test-FileCookieStore-gh1192-2.js:6:13)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant