Improved error management on environment reading.
This commit is contained in:
parent
52e4bce548
commit
b17a258bc8
12
src/main.cr
12
src/main.cr
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user