amirkdv/dockergen

Handle errors more elegantly

Closed this issue · 0 comments

The current first draft effective does not handle errors properly:

begin
  DockerGen::Build.new(def_yaml, build_dir, base_dir, force).generate
rescue Exception => e
  puts e.message
  puts e.backtrace if ENV['DEBUG']
  exit(1)
end

Instead create a main superclass for dockegen errors, e.g. DockerGen::Errors::DockerGenError that should be handled differently than other Ruby Exceptions.