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
We have an application running stable for several months but today we got a server crash because of an ENOENT, utime error, from the file server.js line 156
After looking at the code I can see it's related to changing the file modified time:
fs.utimes(...
if (err) { ...
throw err
Even tough the throw is inside a try-catch block the application crashed. Interestingly the file was properly uploaded, moved and the time stamp was actually updated.
I understand it's mysterious than the try-catch block failed to do its job, but as it seems to be a small error does it justify risking a throw?
Any clue on how to prevent it, or should I send a pull request replacing the throw with a log message?
Thanks!
The text was updated successfully, but these errors were encountered:
Yeah, that call to "throw" is very sloppy on my part. It's not technically part of the try/catch since it happens in a callback function. It should be removed and replaced with a console.log. If you want to submit a PR with this change that would be great :)
Hi,
We have an application running stable for several months but today we got a server crash because of an ENOENT, utime error, from the file server.js line 156
After looking at the code I can see it's related to changing the file modified time:
Even tough the throw is inside a try-catch block the application crashed. Interestingly the file was properly uploaded, moved and the time stamp was actually updated.
I understand it's mysterious than the try-catch block failed to do its job, but as it seems to be a small error does it justify risking a throw?
Any clue on how to prevent it, or should I send a pull request replacing the throw with a log message?
Thanks!
The text was updated successfully, but these errors were encountered: