From b916bc809200dfc55b4b2de5b75e98cce3eb5876 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Fri, 15 Mar 2019 08:01:10 +0000 Subject: [PATCH] Include plugin name in the exception when the plugin required by requires_redmine_plugin is not found (#31030). MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/redmine/plugin.rb b/lib/redmine/plugin.rb index 8b43ff2f5..75161def4 100644 --- a/lib/redmine/plugin.rb +++ b/lib/redmine/plugin.rb @@ -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| -- 2.39.5