Check file existence instead of rescuing LoadError

This commit is contained in:
Jack Nagel 2014-12-31 11:13:45 -05:00
parent 2cb160dc46
commit 5bf92cd7ca

View File

@ -72,11 +72,8 @@ class Formulary
def load_file
STDERR.puts "#{$0} (#{self.class.name}): loading #{path}" if ARGV.debug?
begin
raise FormulaUnavailableError.new(name) unless path.file?
require(path)
rescue LoadError => e
raise FormulaUnavailableError, name, e.backtrace
end
end
end