Method: CSVPlusPlus::ErrorFormatter#handle_error

Defined in:
lib/csv_plus_plus/error_formatter.rb

#handle_error(error) ⇒ Object

Nicely handle a given error. How it’s handled depends on if it’s our error and if @options.verbose

Parameters:



24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/csv_plus_plus/error_formatter.rb', line 24

def handle_error(error)
  # make sure that we're on a newline (verbose mode will probably be in the middle of printing a benchmark)
  puts("\n\n") if @options.verbose

  case error
  when ::CSVPlusPlus::Error::Error
    handle_internal_error(error)
  when ::Google::Apis::ClientError
    handle_google_error(error)
  else
    unhandled_error(error)
  end
end