Class: Errordeck::Exception
- Inherits:
-
Object
- Object
- Errordeck::Exception
- Defined in:
- lib/errordeck/errordeck/issue/exception.rb
Instance Attribute Summary collapse
-
#module ⇒ Object
Returns the value of attribute module.
-
#stacktrace ⇒ Object
Returns the value of attribute stacktrace.
-
#thread_id ⇒ Object
Returns the value of attribute thread_id.
-
#type ⇒ Object
Returns the value of attribute type.
-
#value ⇒ Object
Returns the value of attribute value.
Class Method Summary collapse
Instance Method Summary collapse
- #as_json(*_options) ⇒ Object
-
#initialize(type, value, stacktrace, module_name, thread_id) ⇒ Exception
constructor
A new instance of Exception.
- #to_json(*options) ⇒ Object
Constructor Details
#initialize(type, value, stacktrace, module_name, thread_id) ⇒ Exception
7 8 9 10 11 12 13 |
# File 'lib/errordeck/errordeck/issue/exception.rb', line 7 def initialize(type, value, stacktrace, module_name, thread_id) @type = type @value = value @stacktrace = stacktrace @module = module_name @thread_id = thread_id end |
Instance Attribute Details
#module ⇒ Object
Returns the value of attribute module.
5 6 7 |
# File 'lib/errordeck/errordeck/issue/exception.rb', line 5 def module @module end |
#stacktrace ⇒ Object
Returns the value of attribute stacktrace.
5 6 7 |
# File 'lib/errordeck/errordeck/issue/exception.rb', line 5 def stacktrace @stacktrace end |
#thread_id ⇒ Object
Returns the value of attribute thread_id.
5 6 7 |
# File 'lib/errordeck/errordeck/issue/exception.rb', line 5 def thread_id @thread_id end |
#type ⇒ Object
Returns the value of attribute type.
5 6 7 |
# File 'lib/errordeck/errordeck/issue/exception.rb', line 5 def type @type end |
#value ⇒ Object
Returns the value of attribute value.
5 6 7 |
# File 'lib/errordeck/errordeck/issue/exception.rb', line 5 def value @value end |
Class Method Details
.parse_from_exception(exception, project_root) ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'lib/errordeck/errordeck/issue/exception.rb', line 15 def self.parse_from_exception(exception, project_root) exception_type = exception.class.to_s exception_value = exception. exception_stacktrace = Errordeck::Stacktrace.parse_from_backtrace(exception.backtrace, project_root) exception_module = exception_type.split("::")[0] exception_thread_id = Thread.current.object_id [new(exception_type, exception_value, exception_stacktrace, exception_module, exception_thread_id)] end |
Instance Method Details
#as_json(*_options) ⇒ Object
25 26 27 28 29 30 31 32 33 |
# File 'lib/errordeck/errordeck/issue/exception.rb', line 25 def as_json(*) { type: @type, value: @value, stacktraces: @stacktrace, module: @module, thread_id: @thread_id } end |
#to_json(*options) ⇒ Object
35 36 37 |
# File 'lib/errordeck/errordeck/issue/exception.rb', line 35 def to_json(*) JSON.generate(as_json, *) end |