Sha256: 711a31223b00d9370d7acb8d8ac5f11578b00ff3ea1b32f98ae30352fd5945b2

Contents?: true

Size: 1.68 KB

Versions: 304

Compression:

Stored size: 1.68 KB

Contents

module Scan
  # This classes methods are called when something goes wrong in the building process
  class ErrorHandler
    class << self
      # @param [String] The output of the errored build
      # This method should raise an exception in any case, as the return code indicated a failed build
      def handle_build_error(output)
        # The order of the handling below is import
        case output
        when /US\-ASCII/
          print "Your shell environment is not correctly configured"
          print "Instead of UTF-8 your shell uses US-ASCII"
          print "Please add the following to your '~/.bashrc':"
          print ""
          print "       export LANG=en_US.UTF-8"
          print "       export LANGUAGE=en_US.UTF-8"
          print "       export LC_ALL=en_US.UTF-8"
          print ""
          print "You'll have to restart your shell session after updating the file."
          print "If you are using zshell or another shell, make sure to edit the correct bash file."
          print "For more information visit this stackoverflow answer:"
          print "https://stackoverflow.com/a/17031697/445598"
        when /Testing failed/
          UI.build_failure!("Error building the application - see the log above")
        when /Executed/
          # this is *really* important:
          # we don't want to raise an exception here
          # as we handle this in runner.rb at a later point
          # after parsing the actual test results
          return
        end
        UI.build_failure!("Error building/testing the application - see the log above")
      end

      private

      # Just to make things easier
      def print(text)
        UI.error(text)
      end
    end
  end
end

Version data entries

304 entries across 304 versions & 1 rubygems

Version Path
fastlane-2.74.0.beta.20180106010004 scan/lib/scan/error_handler.rb
fastlane-2.73.0 scan/lib/scan/error_handler.rb
fastlane-2.73.0.beta.20180105010003 scan/lib/scan/error_handler.rb
fastlane-2.73.0.beta.20180104010004 scan/lib/scan/error_handler.rb
fastlane-2.73.0.beta.20180103010003 scan/lib/scan/error_handler.rb
fastlane-2.72.0 scan/lib/scan/error_handler.rb
fastlane-2.72.0.beta.20180102010003 scan/lib/scan/error_handler.rb
fastlane-2.72.0.beta.20180101010003 scan/lib/scan/error_handler.rb
fastlane-2.72.0.beta.20171231010003 scan/lib/scan/error_handler.rb
fastlane-2.71.1 scan/lib/scan/error_handler.rb
fastlane-2.72.0.beta.20171230010003 scan/lib/scan/error_handler.rb
fastlane-2.72.0.beta.20171229010003 scan/lib/scan/error_handler.rb
fastlane-2.72.0.beta.20171228010004 scan/lib/scan/error_handler.rb
fastlane-2.71.0 scan/lib/scan/error_handler.rb
fastlane-2.71.0.beta.20171227010004 scan/lib/scan/error_handler.rb
fastlane-2.71.0.beta.20171226010004 scan/lib/scan/error_handler.rb
fastlane-2.71.0.beta.20171225010003 scan/lib/scan/error_handler.rb
fastlane-2.71.0.beta.20171224010003 scan/lib/scan/error_handler.rb
fastlane-2.71.0.beta.20171223010003 scan/lib/scan/error_handler.rb
fastlane-2.71.0.beta.20171222010003 scan/lib/scan/error_handler.rb