Module: OFlow::HasErrorHandler
Overview
Provides functionality to find an error handler Task which is how error are handled in the system. Each Flow or Task can have a different error handler. If a Flow does not have an error handler the error bubbles up to the next Flow until an error handler is found.
Instance Method Summary collapse
-
#error_handler=(t) ⇒ Object
Sets avaliable for handling errors.
-
#handle_error(e) ⇒ Object
Handles errors by putting a requestion on the error handler Task.
Instance Method Details
#error_handler=(t) ⇒ Object
Sets avaliable for handling errors.
12 13 14 |
# File 'lib/oflow/haserrorhandler.rb', line 12 def error_handler=(t) @error_handler = t end |
#handle_error(e) ⇒ Object
Handles errors by putting a requestion on the error handler Task.
18 19 20 21 22 23 24 25 26 |
# File 'lib/oflow/haserrorhandler.rb', line 18 def handle_error(e) handler = error_handler() if handler.nil? puts "** [#{full_name()}] #{e.class}: #{e.}" e.backtrace.each { |line| puts " #{line}" } else handler.receive(nil, Box.new([e, full_name()])) end end |