clarify error message
authorAJ ONeal <aj@therootcompany.com>
Sat, 26 Sep 2020 20:35:31 +0000 (20:35 +0000)
committerAJ ONeal <aj@therootcompany.com>
Sat, 26 Sep 2020 20:35:31 +0000 (20:35 +0000)
_webi/releases.js

index 83eeb14ab41fa9948b821e04273e824d31578ba0..f5ef319dae5bb45af268b46b4282121ddf6afd32 100644 (file)
@@ -7,7 +7,12 @@ var _normalize = require('../_webi/normalize.js');
 
 var Releases = module.exports;
 Releases.get = async function (pkgdir) {
-  var get = require(path.join(pkgdir, 'releases.js'));
+  var get;
+  try {
+    get = require(path.join(pkgdir, 'releases.js'));
+  } catch (e) {
+    throw new Error('no releases.js for', pkgdir.split(/[\/\\]+/).pop());
+  }
   return get(request).then(function (all) {
     return _normalize(all);
   });