From 2dbaebd6492256fdcfd1a2891f9adce93b61d941 Mon Sep 17 00:00:00 2001 From: Milan Zazrivec Date: Mon, 13 Aug 2018 10:28:01 +0200 Subject: [PATCH] rake locale:plugin:find -- print nice error for non-existent plugin --- lib/tasks/locale.rake | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/tasks/locale.rake b/lib/tasks/locale.rake index 98252386afb3..419f32cc9aa2 100644 --- a/lib/tasks/locale.rake +++ b/lib/tasks/locale.rake @@ -157,7 +157,12 @@ namespace :locale do exit 1 end @domain = args[:engine].gsub('::', '_') - @engine = "#{args[:engine].camelize}::Engine".constantize + begin + @engine = "#{args[:engine].camelize}::Engine".constantize + rescue NameError + warn "The specified plugin #{args[:engine]} does not exist." + exit 1 + end @engine_root = @engine.root # extract plugin's yaml strings