Sha256: 6f6d807fa5a085f26b9493b8002b6c8919697c2493dadc2a285bb7051dbef96c

Contents?: true

Size: 860 Bytes

Versions: 2

Compression:

Stored size: 860 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
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
fastlane-2.33.0.beta.20170519010039 fastlane_core/lib/fastlane_core/ui/errors/fastlane_exception.rb
fastlane-2.32.0 fastlane_core/lib/fastlane_core/ui/errors/fastlane_exception.rb