aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2019-03-11 15:34:55 -1000
committercel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2019-03-11 15:34:55 -1000
commitbf2555a2efdf6055309402b92288818fdbabea3e (patch)
tree1ce502fa2d1c44d93d529949f40b48cfac2cabad
parent7af18601396fa8fd08dc94fa25166780e3757a7b (diff)
downloadpatchfoo-bf2555a2efdf6055309402b92288818fdbabea3e.tar.gz
patchfoo-bf2555a2efdf6055309402b92288818fdbabea3e.zip
script: catch resolve error
-rw-r--r--lib/app.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/app.js b/lib/app.js
index cdbc93c..f853d24 100644
--- a/lib/app.js
+++ b/lib/app.js
@@ -1407,7 +1407,9 @@ App.prototype.getScript = function (filepath, cb) {
var self = this
fs.stat(filename, function (err, stat) {
if (err) return cb(err)
- var resolved = require.resolve(filename)
+ var resolved
+ try { resolved = require.resolve(filename) }
+ catch(e) { return cb(e) }
var prevMtime = self.mtimes[resolved]
var mtime = stat.mtime.getTime()
if (mtime !== prevMtime) {