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
I have following function which returns a promise:
function getStats (filePath) {
return new Promise(function (fulfill, reject) {
fs.stat(filePath, function (error, stats) {
if (error)
reject(error)
else
fulfill(stats)
})
})
}
Unfortunately I forgot to require fs before.
The outcome was, that the execution of the code stopped when I used the promise later.
Is this the correct behavior and how am I supposed to catch the exception then?
The text was updated successfully, but these errors were encountered:
I have following function which returns a promise:
Unfortunately I forgot to require
fs
before.The outcome was, that the execution of the code stopped when I used the promise later.
Is this the correct behavior and how am I supposed to catch the exception then?
The text was updated successfully, but these errors were encountered: