Closed troelskn closed 11 years ago
This should probably be consistent and raise a MissingPackage error anytime a require package cannot be found... and you have two scopes: packages inside policies and packages inside packages. If you want to fix both cases and submit a pull request that'd be great.
Might have to do a bit more research though - right now it appears there is already a raise anytime we search the package database.... Look at Policy line 96...
Though maybe the problem it find_all returns an array now which is always non-nil?
You're right. Changing this line:
raise "Package definition not found for key: #{p}" unless package
into:
raise "Package definition not found for key: #{p}" unless package && package.any?
gives a useful error. Do you want a pull for this?
Sure. I'm not sure package &&
is required... Look and see if the library always returns an array.
Looks right. I'll wrap the error message in a typed exception while I'm at it.
Closing this as duplicate of #154
Requiring an unmet dependency gives a rather obscure error message:
I would suggest adding an explicit check and meaningful error message in
package/chooser.rb
, as in: