Reword generic error message on config load

This commit is contained in:
Stuart Frost 2023-07-25 08:46:13 +01:00
parent d9b2d69055
commit 4741c9f4c4
2 changed files with 2 additions and 2 deletions

View file

@ -85,7 +85,7 @@ module Ameba
end end
it "raises when custom config file doesn't exist" do it "raises when custom config file doesn't exist" do
expect_raises(Exception, "Config file is invalid: Config file does not exist foo.yml") do expect_raises(Exception, "Unable to load config file: Config file does not exist foo.yml") do
Config.load "foo.yml" Config.load "foo.yml"
end end
end end

View file

@ -115,7 +115,7 @@ class Ameba::Config
end end
Config.new YAML.parse(content) Config.new YAML.parse(content)
rescue e rescue e
raise "Config file is invalid: #{e.message}" raise "Unable to load config file: #{e.message}"
end end
protected def self.read_config(path = nil) protected def self.read_config(path = nil)