lib/flare_up/boot.rb in flare-up-0.3 vs lib/flare_up/boot.rb in flare-up-0.4

- old
+ new

@@ -6,13 +6,14 @@ def self.boot(options) conn = create_connection(options) copy = create_copy_command(options) begin + Emitter.info("Executing command: #{copy.get_command}") handle_load_errors(copy.execute(conn)) rescue CopyCommandError => e - CLI.output_error("\x1b[31m#{e.message}") + Emitter.error(e.message) CLI.bailout(1) end end @@ -38,13 +39,14 @@ end # TODO: How can we test this? def self.handle_load_errors(stl_load_errors) return if stl_load_errors.empty? - puts "\x1b[31mThere was an error processing the COPY command. Displaying the last (#{stl_load_errors.length}) errors." + Emitter.error("There was an error processing the COPY command. Displaying the last (#{stl_load_errors.length}) errors.") stl_load_errors.each do |e| - puts e.pretty_print + Emitter.error(e.pretty_print) end + CLI.bailout(1) end end end \ No newline at end of file