Sha256: c94a624aed321f894a6f5f4000118140955a4d102194e7f6b7a79e3c913b46fd

Contents?: true

Size: 1.08 KB

Versions: 25

Compression:

Stored size: 1.08 KB

Contents

module Xcov
  class ErrorHandler

    class << self

      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

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

      private

      def print(text)
        UI.message text.red
      end

    end

  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
xcov-1.8.1 lib/xcov/error_handler.rb
xcov-1.8.0 lib/xcov/error_handler.rb
xcov-1.7.5 lib/xcov/error_handler.rb
xcov-1.7.4 lib/xcov/error_handler.rb
xcov-1.7.3 lib/xcov/error_handler.rb
xcov-1.7.2 lib/xcov/error_handler.rb
xcov-1.7.1 lib/xcov/error_handler.rb
xcov-1.7.0 lib/xcov/error_handler.rb
xcov-1.6.0 lib/xcov/error_handler.rb
xcov-1.5.1 lib/xcov/error_handler.rb
xcov-1.5.0 lib/xcov/error_handler.rb
xcov-1.4.3 lib/xcov/error_handler.rb
xcov-1.4.2 lib/xcov/error_handler.rb
xcov-1.4.1 lib/xcov/error_handler.rb
xcov-1.4.0 lib/xcov/error_handler.rb
xcov-1.3.5 lib/xcov/error_handler.rb
xcov-1.3.4 lib/xcov/error_handler.rb
xcov-1.3.3 lib/xcov/error_handler.rb
xcov-1.3.2 lib/xcov/error_handler.rb
xcov-1.3.1 lib/xcov/error_handler.rb