Sha256: 83a11c6ce4251be00601a7e94ae2f12677e1dfa2f5fdcc90df3aba3fe3c6e152

Contents?: true

Size: 1.68 KB

Versions: 169

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.user_error!("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.user_error!("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

169 entries across 169 versions & 2 rubygems

Version Path
fastlane-2.31.0.beta.20170515010044 scan/lib/scan/error_handler.rb
fastlane-2.31.0.beta.20170514010036 scan/lib/scan/error_handler.rb
fastlane-2.31.0.beta.20170513010043 scan/lib/scan/error_handler.rb
fastlane-2.30.2 scan/lib/scan/error_handler.rb
fastlane-2.31.0.beta.20170512010054 scan/lib/scan/error_handler.rb
fastlane-2.30.1 scan/lib/scan/error_handler.rb
fastlane-2.30.0 scan/lib/scan/error_handler.rb
fastlane-2.29.1 scan/lib/scan/error_handler.rb
fastlane-2.30.0.beta.20170511010018 scan/lib/scan/error_handler.rb
fastlane-2.30.0.beta.20170510010041 scan/lib/scan/error_handler.rb
fastlane-2.29.0 scan/lib/scan/error_handler.rb
fastlane-2.29.0.beta.20170509010055 scan/lib/scan/error_handler.rb
fastlane-2.29.0.beta.20170508010014 scan/lib/scan/error_handler.rb
fastlane-2.29.0.beta.20170507010054 scan/lib/scan/error_handler.rb
fastlane-2.29.0.beta.20170506010047 scan/lib/scan/error_handler.rb
fastlane-2.28.9 scan/lib/scan/error_handler.rb
fastlane-2.29.0.beta.20170505010029 scan/lib/scan/error_handler.rb
fastlane-2.29.0.beta.20170504010033 scan/lib/scan/error_handler.rb
fastlane-2.28.8 scan/lib/scan/error_handler.rb
fastlane-2.29.0.beta.20170503010035 scan/lib/scan/error_handler.rb