lib/timber/events/exception.rb in timber-1.1.14 vs lib/timber/events/exception.rb in timber-2.0.0

- old
+ new

@@ -1,11 +1,11 @@ module Timber module Events # The exception event is used to track exceptions. # - # @note This event should be installed automatically through probes, - # such as the {Probes::ActionDispatchDebugExceptions} probe. + # @note This event should be installed automatically through integrations, + # such as the {Integrations::ActionDispatch::DebugExceptions} integration. class Exception < Timber::Event attr_reader :name, :exception_message, :backtrace def initialize(attributes) @name = attributes[:name] || raise(ArgumentError.new(":name is required")) @@ -14,10 +14,11 @@ backtrace = attributes[:backtrace] if backtrace.nil? || backtrace == [] raise(ArgumentError.new(":backtrace is required")) end - @backtrace = backtrace.collect { |line| parse_backtrace_line(line) } + # 10 items max + @backtrace = backtrace[0..9].collect { |line| parse_backtrace_line(line) } end def to_hash {name: name, message: exception_message, backtrace: backtrace} end \ No newline at end of file