Skip to content

Commit

Permalink
Updates error message when missing config file
Browse files Browse the repository at this point in the history
  • Loading branch information
afred committed May 10, 2024
1 parent 9f97998 commit b4ceec1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/sony_ci_api/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,12 @@ def load_config!(config = {})
elsif config.is_a? Hash
config_hash = config
else
raise InvalidConfigError, "config is expected to be a valid YAML file or " \
"a Hash, but #{config.class} was given. "
msg = if config.is_a? String
"config file '#{config}' does not exist."
else
"config is expected to be a valid YAML file or a Hash, but #{config.class} was given. "
end
raise InvalidConfigError, msg
end
@config = config_hash.with_indifferent_access
rescue Psych::SyntaxError, Psych::DisallowedClass => e
Expand Down

0 comments on commit b4ceec1

Please sign in to comment.