Sha256: d58e68c2cf8b650a79727cb94e2b747d38cd67a5c1147f92fbcf9b5dca2728ef

Contents?: true

Size: 892 Bytes

Versions: 17

Compression:

Stored size: 892 Bytes

Contents

module Snapshot
  # This classes methods are called when something goes wrong in the building process
  class ErrorHandler
    class TestsFailedException < StandardError
    end

    class << self
      # @param [Array] The output of the errored build (line by line)
      # This method should raise an exception in any case, as the return code indicated a failed build
      def handle_test_error(output, return_code)
        # The order of the handling below is import

        if return_code == 65
          raise TestsFailedException.new, "Tests failed - check out the log above".red
        end

        case output
        when /com\.apple\.CoreSimulator\.SimError/
          print "The simulator failed to launch - retrying..."
        end
      end

      private

      # Just to make things easier
      def print(text)
        Helper.log.error text.red
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
snapshot-1.5.0 lib/snapshot/error_handler.rb
snapshot-1.4.4 lib/snapshot/error_handler.rb
snapshot-1.4.3 lib/snapshot/error_handler.rb
snapshot-1.4.2 lib/snapshot/error_handler.rb
snapshot-1.4.1 lib/snapshot/error_handler.rb
snapshot-1.4.0 lib/snapshot/error_handler.rb
snapshot-1.3.0 lib/snapshot/error_handler.rb
snapshot-1.2.2 lib/snapshot/error_handler.rb
snapshot-1.2.1 lib/snapshot/error_handler.rb
snapshot-1.2.0 lib/snapshot/error_handler.rb
snapshot-1.1.1 lib/snapshot/error_handler.rb
snapshot-1.1.0 lib/snapshot/error_handler.rb
snapshot-1.0.5 lib/snapshot/error_handler.rb
snapshot-1.0.4 lib/snapshot/error_handler.rb
snapshot-1.0.3 lib/snapshot/error_handler.rb
snapshot-1.0.2 lib/snapshot/error_handler.rb
snapshot-1.0.1 lib/snapshot/error_handler.rb