]> source.dussan.org Git - redmine.git/commitdiff
Include plugin name in the exception when the plugin required by requires_redmine_plu...
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Fri, 15 Mar 2019 08:01:10 +0000 (08:01 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Fri, 15 Mar 2019 08:01:10 +0000 (08:01 +0000)
Patch by Jérôme BATAILLE and Go MAEDA.

git-svn-id: http://svn.redmine.org/redmine/trunk@17960 e93f8b46-1217-0410-a6f0-8f06a7374b81

lib/redmine/plugin.rb

index 8b43ff2f5d1c67a432234ca897f188c501cdd694..75161def448259837fc5e71b2c1df2dcbb4fa036 100644 (file)
@@ -271,7 +271,11 @@ module Redmine
       arg = { :version_or_higher => arg } unless arg.is_a?(Hash)
       arg.assert_valid_keys(:version, :version_or_higher)
 
-      plugin = Plugin.find(plugin_name)
+      begin
+        plugin = Plugin.find(plugin_name)
+      rescue PluginNotFound
+        raise PluginRequirementError.new("#{id} plugin requires the #{plugin_name} plugin")
+      end
       current = plugin.version.split('.').collect(&:to_i)
 
       arg.each do |k, v|