From bcf5474410be6198bd0bf04d1ea7a636962194e2 Mon Sep 17 00:00:00 2001 From: Ole Claussen Date: Mon, 22 May 2017 17:02:13 +0200 Subject: Fail loudly when the gem installer finds conflicting gem requirements Signed-off-by: Ole Claussen --- lib/chef/exceptions.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/chef/exceptions.rb') diff --git a/lib/chef/exceptions.rb b/lib/chef/exceptions.rb index a09a3a062c..1f4f5c595b 100644 --- a/lib/chef/exceptions.rb +++ b/lib/chef/exceptions.rb @@ -521,5 +521,11 @@ This error is most often caused by network issues (proxies, etc) outside of chef # exception specific to invalid usage of 'dsc_resource' resource class DSCModuleNameMissing < ArgumentError; end + + class GemRequirementConflict < RuntimeError + def initialize(gem_name, option, value1, value2) + super "Conflicting requirements for gem '#{gem_name}': Both #{value1.inspect} and #{value2.inspect} given for option #{option.inspect}" + end + end end end -- cgit v1.2.1