Exception: Exception
- Defined in:
- lib/dramatis/error.rb
Overview
Dramatis modifies exceptions thrown within the context of an actor rpc call, combinding the the backtraces generated by native language exceptions in order to put them in a more useful context:
-
Exceptions are chained across threads using continuation information
-
Dramatis runtime internal call frames are removed
Direct Known Subclasses
Dramatis::Runtime::Actor::Main::DefaultBehavior::Exception, Dramatis::Runtime::Scheduler::Done
Instance Method Summary collapse
-
#_dramatis_backtrace ⇒ Object
:stopdoc:.
-
#_dramatis_reraise ⇒ Object
:nodoc:.
-
#backtrace ⇒ Object
call-seq: backtrace -> array of strings.
-
#filter(array) ⇒ Object
:nodoc:.
Instance Method Details
#_dramatis_backtrace ⇒ Object
:stopdoc:
29 |
# File 'lib/dramatis/error.rb', line 29 alias _dramatis_backtrace backtrace |
#_dramatis_reraise ⇒ Object
:nodoc:
48 49 50 51 52 53 54 55 56 |
# File 'lib/dramatis/error.rb', line 48 def _dramatis_reraise #:nodoc: # return # p "reraise" if @_dramatis_raw_backtrace @_dramatis_raw_backtrace = backtrace + filter( caller ) else @_dramatis_raw_backtrace = filter( backtrace ) + filter( caller ) end end |
#backtrace ⇒ Object
call-seq: backtrace -> array of strings
dramatis wraps and filters the native exception backtrace method in order to augment the backtrace to follow the backtrace through actor rpc calls.
39 40 41 42 43 44 45 46 |
# File 'lib/dramatis/error.rb', line 39 def backtrace # p "back #{self}" if instance_variable_defined? :@_dramatis_raw_backtrace filter @_dramatis_raw_backtrace else _dramatis_backtrace end end |
#filter(array) ⇒ Object
:nodoc:
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 |
# File 'lib/dramatis/error.rb', line 58 def filter array #:nodoc: # pp "_", array filtered = [] array.each do |v| file, line, func = v.split ':' file =~ %r{/lib/dramatis/} or ( filtered << v and next ) func =~ %r{\Wmaybe_deadlock\W} and next file =~ %r{/runtime/scheduler} and func =~ %r{\Wrun\W} and break filtered << v end # pp "0", filtered # remove queueing delivery array = filtered filtered = [] skipping = false array.each do |v| # p v file, line, func = v.split ':' if file !~ %r{/lib/dramatis/} # p "not skipping x" skipping = false filtered << v next end if !skipping and ( ( file =~ %r{/runtime/task} and func =~ %r{\Wqueued\W} ) or ( file =~ %r{/runtime/actor} and func =~ %r{\Wsend\W} ) or # r18, r19 ( file =~ %r{/runtime/actor} and func =~ %r{\Wdeliver\W} ) ) # jr # p "skipping" skipping = true next end if file =~ %r{/dramatis/actor/name} and func =~ %r{\Wmethod_missing\W} # p "not skipping" skipping = false next end skipping or filtered << v end # pp "filt", filtered # pp args[0] filtered # super args[0] end |