make error message from loader more useful

This commit is contained in:
leaf corcoran 2016-04-13 19:47:37 -07:00
parent fdfd314ebc
commit 1a776e30e0

View File

@ -30,7 +30,8 @@ with_dev = (fn) ->
mod\match("moon%.") or mod == "moon"
if testable
dev_cache[mod] = assert(loadfile(assert loader mod))!
fname = assert loader(mod), "failed to find module: #{mod}"
dev_cache[mod] = assert(loadfile fname)!
return dev_cache[mod]
old_require mod