Skip to content

Commit 66151b6

Browse files
committed
use ConfigurationError to describe YAML errors
1 parent b44fab0 commit 66151b6

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1111
### Changed
1212
- Simplified the use of `Array.each` with a return statement; it's now simply `Array.find`
1313
- `autolocate!` for Arduino installations now raises `ArduinoInstallationError` if `force_install` fails
14+
- Errors due to missing YAML are now named `ConfigurationError`
1415

1516
### Deprecated
1617

lib/arduino_ci/ci_config.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535
}.freeze
3636
module ArduinoCI
3737

38+
class ConfigurationError < StandardError; end
39+
3840
# The filename controlling (overriding) the defaults for testing.
3941
# Files with this name can be used in the root directory of the Arduino library and in any/all of the example directories
4042
CONFIG_FILENAMES = [
@@ -108,7 +110,7 @@ def validate_data(rootname, source, schema)
108110
# @return [ArduinoCI::CIConfig] a reference to self
109111
def load_yaml(path)
110112
yml = YAML.load_file(path)
111-
raise "The YAML file at #{path} failed to load" unless yml
113+
raise ConfigurationError, "The YAML file at #{path} failed to load" unless yml
112114

113115
if yml.include?("packages")
114116
yml["packages"].each do |k, v|

0 commit comments

Comments
 (0)