class Sentry::SingleExceptionInterface
Attributes
module[R]
stacktrace[R]
thread_id[R]
type[R]
value[R]
Public Class Methods
build_with_stacktrace(exception:, stacktrace_builder:)
click to toggle source
patch this method if you want to change an exception's stacktrace frames also see `StacktraceBuilder.build`.
# File lib/sentry/interfaces/single_exception.rb, line 21 def self.build_with_stacktrace(exception:, stacktrace_builder:) stacktrace = stacktrace_builder.build(backtrace: exception.backtrace) new(exception: exception, stacktrace: stacktrace) end
new(exception:, stacktrace: nil)
click to toggle source
# File lib/sentry/interfaces/single_exception.rb, line 5 def initialize(exception:, stacktrace: nil) @type = exception.class.to_s @value = (exception.message || "").byteslice(0..Event::MAX_MESSAGE_SIZE_IN_BYTES) @module = exception.class.to_s.split('::')[0...-1].join('::') @thread_id = Thread.current.object_id @stacktrace = stacktrace end
Public Instance Methods
to_hash()
click to toggle source
Calls superclass method
Sentry::Interface#to_hash
# File lib/sentry/interfaces/single_exception.rb, line 13 def to_hash data = super data[:stacktrace] = data[:stacktrace].to_hash if data[:stacktrace] data end