Catching more than we need to.
This commit is contained in:
1 parent
bc1c5e4c74
commit
d54b46806c
1 file changed
+6
-6
+6
-6
@@ -46,14 +46,14 @@ class Foreman::CLI < Thor
|
|||||||
def export(format, location=nil)
|
def export(format, location=nil)
|
||||||
check_procfile!
|
check_procfile!
|
||||||
|
|
||||||
classy_format = classify(format)
|
begin
|
||||||
formatter = constantize("Foreman::Export::#{ classy_format }")
|
classy_format = classify(format)
|
||||||
|
formatter = constantize("Foreman::Export::#{ classy_format }")
|
||||||
|
rescue NameError => ex
|
||||||
|
error "Unknown export format: #{format} (no class Foreman::Export::#{ classy_format })."
|
||||||
|
end
|
||||||
|
|
||||||
formatter.new(engine, options).export(location)
|
formatter.new(engine, options).export(location)
|
||||||
|
|
||||||
rescue NameError => ex
|
|
||||||
error "Unknown export format: #{format}."
|
|
||||||
raise ex
|
|
||||||
rescue Foreman::Export::Exception => ex
|
rescue Foreman::Export::Exception => ex
|
||||||
error ex.message
|
error ex.message
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in new issue
Block a user