Class: Xcov::ErrorHandler

Inherits:
Object
  • Object
show all
Defined in:
lib/xcov/error_handler.rb

Class Method Summary collapse

Class Method Details

.handle_error(output) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/xcov/error_handler.rb', line 7

def handle_error(output)
  case output
  when /XccoverageFileNotFound/
    print "Unable to find any .xccoverage file."
    print "Make sure you have enabled 'Gather code coverage' setting on your scheme settings."
    print "Alternatively you can provide the full path to your .xccoverage file."
  when /UnableToParseXccoverageFile/
    print "There was an error converting the .xccoverage file to json."
  when /CoverageUnderThreshold/
    print "The build has been marked as failed because minimum overall coverage has not been reached."
  when /UnableToMapJsonToXcovModel/
    print "There was an error converting the json file to xcov's model objects."
  end
  raise "Error creating your coverage report - see the log above".red
end

.handle_error_with_custom_message(error, custom_message) ⇒ Object



23
24
25
26
# File 'lib/xcov/error_handler.rb', line 23

def handle_error_with_custom_message(error, custom_message)
  print custom_message
  handle_error error
end