Class: Zikrash::ExceptionInfo
- Inherits:
-
Object
- Object
- Zikrash::ExceptionInfo
- Defined in:
- lib/zikrash/exception_info.rb
Instance Attribute Summary collapse
-
#application_backtrace ⇒ Object
Returns the value of attribute application_backtrace.
-
#exception_class ⇒ Object
Returns the value of attribute exception_class.
-
#full_backtrace ⇒ Object
Returns the value of attribute full_backtrace.
-
#message ⇒ Object
Returns the value of attribute message.
Instance Method Summary collapse
- #data ⇒ Object
-
#initialize(exception) ⇒ ExceptionInfo
constructor
A new instance of ExceptionInfo.
Constructor Details
#initialize(exception) ⇒ ExceptionInfo
Returns a new instance of ExceptionInfo.
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/zikrash/exception_info.rb', line 8 def initialize(exception) return false unless (exception.respond_to?(:message) && exception.respond_to?(:backtrace)) self.exception_class = exception.is_a?(Class) ? exception.to_s : exception.class.to_s self. = exception. self.full_backtrace = exception.backtrace self.application_backtrace = Rails.backtrace_cleaner.clean(exception.backtrace) self end |
Instance Attribute Details
#application_backtrace ⇒ Object
Returns the value of attribute application_backtrace.
6 7 8 |
# File 'lib/zikrash/exception_info.rb', line 6 def application_backtrace @application_backtrace end |
#exception_class ⇒ Object
Returns the value of attribute exception_class.
3 4 5 |
# File 'lib/zikrash/exception_info.rb', line 3 def exception_class @exception_class end |
#full_backtrace ⇒ Object
Returns the value of attribute full_backtrace.
5 6 7 |
# File 'lib/zikrash/exception_info.rb', line 5 def full_backtrace @full_backtrace end |
#message ⇒ Object
Returns the value of attribute message.
4 5 6 |
# File 'lib/zikrash/exception_info.rb', line 4 def @message end |
Instance Method Details
#data ⇒ Object
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/zikrash/exception_info.rb', line 19 def data all_backtrace, relevant_code = backtrace_with_relevant_code { class: exception_class, message: , location: application_backtrace.first, full_backtrace: all_backtrace, relevant_code: relevant_code } end |