Class: Rookout::Processor::RookError
- Inherits:
-
Object
- Object
- Rookout::Processor::RookError
- Defined in:
- lib/rookout/processor/rook_error.rb
Instance Attribute Summary collapse
-
#exception ⇒ Object
readonly
Returns the value of attribute exception.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#parameters ⇒ Object
readonly
Returns the value of attribute parameters.
Instance Method Summary collapse
- #dumps ⇒ Object
-
#initialize(exception, message = "") ⇒ RookError
constructor
A new instance of RookError.
Constructor Details
#initialize(exception, message = "") ⇒ RookError
Returns a new instance of RookError.
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/rookout/processor/rook_error.rb', line 11 def initialize exception, = "" @exception = exception @traceback = exception.backtrace if @exception.is_a? Exceptions::ToolException raw_type = @exception.class.to_s @type = raw_type[raw_type.rindex(":") + 1..raw_type.length] @message = @exception. @parameters = @exception.parameters else @type = "Unknown" @message = @parameters = nil end end |
Instance Attribute Details
#exception ⇒ Object (readonly)
Returns the value of attribute exception.
28 29 30 |
# File 'lib/rookout/processor/rook_error.rb', line 28 def exception @exception end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
27 28 29 |
# File 'lib/rookout/processor/rook_error.rb', line 27 def @message end |
#parameters ⇒ Object (readonly)
Returns the value of attribute parameters.
29 30 31 |
# File 'lib/rookout/processor/rook_error.rb', line 29 def parameters @parameters end |
Instance Method Details
#dumps ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/rookout/processor/rook_error.rb', line 31 def dumps parameters = NamespaceSerializer.dump Namespaces::RubyObjectNamespace.new(@parameters), false exception = NamespaceSerializer.dump Namespaces::RubyObjectNamespace.new(@exception), false backtrace_string = "" unless @exception.backtrace.nil? backtrace_string = @exception.backtrace.join "\n\t" end backtrace_object = Namespaces::RubyObjectNamespace.new(backtrace_string).tailor_limits! traceback = NamespaceSerializer.dump backtrace_object, false Com::Rookout::Error.new message: @message, type: @type, parameters: parameters, exc: exception, traceback: traceback end |