Sha256: ddfaa9cebca61865c1d6375629fc17c11ce8881411027af392b4eb869c110a62

Contents?: true

Size: 978 Bytes

Versions: 2

Compression:

Stored size: 978 Bytes

Contents

module FastlaneCore
  class Interface
    class FastlaneException < StandardError
      def prefix
        '[FASTLANE_EXCEPTION]'
      end

      def caused_by_calling_ui_method?(method_name: nil)
        return false if backtrace.nil? || backtrace[0].nil? || method_name.nil?
        first_frame = backtrace[0]
        if first_frame.include?(method_name) && first_frame.include?('interface.rb')
          true
        else
          false
        end
      end

      def trim_backtrace(method_name: nil)
        if caused_by_calling_ui_method?(method_name: method_name)
          backtrace.drop(2)
        else
          backtrace
        end
      end

      def could_contain_pii?
        caused_by_calling_ui_method?
      end

      def crash_report_message
        return '' if could_contain_pii?
        exception.message
      end
    end
    class FastlaneBuildFailure < FastlaneException
    end

    class FastlaneTestFailure < FastlaneException
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
fastlane-2.32.0.beta.20170518010031 fastlane_core/lib/fastlane_core/ui/errors/fastlane_exception.rb
fastlane-2.31.0 fastlane_core/lib/fastlane_core/ui/errors/fastlane_exception.rb