You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
stat can result in unexpected runtime failures #27
This is a failing example that's close to what I was using.
I'm not sure if the problem is with stat or catchException, but essentially this is the problem:
You can use catchException to discharge an EXCEPTION assumption from your program. Great! If we use enough catchExceptions, the compiler tells us (assuming everything was well-typed) that our program won't have any uncaught exceptions at runtime.
Except it does. catchException doesn't ... catch the exception ... when using stat on a path that doesn't exist.
This threw me for a loop since I was assuming that uncaught runtime exceptions wouldn't happen.
Perhaps we incorrectly assumed the error would be thrown immediately if fs.statSync failed? I'm not at my laptop right now but does it work in node using JS directly if you try to wrap fs.statSync in a try...catch block?
Activity
hdgarrood commentedon Mar 3, 2016
😱 this definitely shouldn't happen.
Perhaps we incorrectly assumed the error would be thrown immediately if
fs.statSyncfailed? I'm not at my laptop right now but does it work in node using JS directly if you try to wrapfs.statSyncin a try...catch block?Thimoteus commentedon Mar 3, 2016
It seems to work as intended in node:
hdgarrood commentedon Mar 5, 2016
Fixed by b1a99f8, released in 0.9.3. Thanks for the report! :)
hdgarrood commentedon Mar 5, 2016
Oops, I meant v0.10.1. I really need to get on and implement
pulp versionto protect me from myself.