Improved error management on environment reading.

master
Luka Vandervelden 2019-06-09 13:51:29 +02:00
parent 52e4bce548
commit b17a258bc8
1 changed files with 11 additions and 1 deletions

View File

@ -132,7 +132,17 @@ class Environment
next
end
@@all << Environment.from_yaml File.read "#{path}/#{child}"
file_path = "#{path}/#{child}"
begin
environment = Environment.from_yaml File.read file_path
rescue e
STDERR << "error loading #{file_path}: " << e << "\n"
# FIXME: Print stacktrace? Debug mode?
next
end
@@all << environment
end
end