Sha256: 2590bda23e17fdd58c4f88379b59adb4b88166aacfa736f7e9fbd96a05b58caa
Contents?: true
Size: 1.55 KB
Versions: 16
Compression:
Stored size: 1.55 KB
Contents
module FastlaneCore class CrashReportGenerator class << self def generate(exception: nil, action: nil) message = format_crash_report_message(exception: exception) crash_report_payload(message: message, action: action) end private def format_crash_report_message(exception: nil) return if exception.nil? backtrace = exception.respond_to?(:trimmed_backtrace) ? exception.trimmed_backtrace : exception.backtrace backtrace = FastlaneCore::CrashReportSanitizer.sanitize_backtrace(backtrace: backtrace).join("\n") message = exception.respond_to?(:prefix) ? exception.prefix : '[EXCEPTION]' message += ': ' if exception.respond_to?(:crash_report_message) exception_message = FastlaneCore::CrashReportSanitizer.sanitize_string(string: exception.crash_report_message) else exception_message = "#{exception.class.name}: #{FastlaneCore::CrashReportSanitizer.sanitize_string(string: exception.message)}" end message += exception_message message = message[0..100] message += "\n" unless exception.respond_to?(:could_contain_pii?) && exception.could_contain_pii? message + backtrace end def crash_report_payload(message: '', action: nil) { 'eventTime' => Time.now.utc.to_datetime.rfc3339, 'serviceContext' => { 'service' => action || 'fastlane', 'version' => Fastlane::VERSION }, 'message' => message }.to_json end end end end
Version data entries
16 entries across 16 versions & 1 rubygems