def handle_step_error(err, msg)

      $stderr.puts '#' * 80
      $stderr.puts
      $stderr.puts '** worker#step intercepted exception **'
      $stderr.puts
      $stderr.puts "Please report issue or fix your #{@storage.class} impl,"
      $stderr.puts
      $stderr.puts "or override Ruote::Worker#handle_step_error(e, msg) so that"
      $stderr.puts "the issue is dealt with appropriately. For example:"
      $stderr.puts
      $stderr.puts "    class Ruote::Worker"
      $stderr.puts "      def handle_step_error(e, msg)"
      $stderr.puts "        logger.error('ruote step error: ' + e.inspect)"
      $stderr.puts "        mailer.send_error('admin@acme.com', e)"
      $stderr.puts "      end"
      $stderr.puts "    end"
      $stderr.puts
      $stderr.puts '# ' * 40
      $stderr.puts
      $stderr.puts 'error class/message/backtrace:'
      $stderr.puts err.class.name
      $stderr.puts err.message.inspect
      $stderr.puts *err.backtrace
      $stderr.puts err.details if err.respond_to?(:details)
      $stderr.puts
      $stderr.puts 'msg:'
      if msg && msg.is_a?(Hash)
        $stderr.puts msg.select { |k, v|
          %w[ action wfid fei ].include?(k)
        }.inspect
      else
        $stderr.puts msg.inspect
      end
      $stderr.puts
      $stderr.puts '#' * 80

      $stderr.flush
    end
def handle_step_error(err, msg)

      $stderr.puts '#' * 80
      $stderr.puts
      $stderr.puts '** worker#step intercepted exception **'
      $stderr.puts
      $stderr.puts "Please report issue or fix your #{@storage.class} impl,"
      $stderr.puts
      $stderr.puts "or override Ruote::Worker#handle_step_error(e, msg) so that"
      $stderr.puts "the issue is dealt with appropriately. For example:"
      $stderr.puts
      $stderr.puts "    class Ruote::Worker"
      $stderr.puts "      def handle_step_error(e, msg)"
      $stderr.puts "        logger.error('ruote step error: ' + e.inspect)"
      $stderr.puts "        mailer.send_error('admin@acme.com', e)"
      $stderr.puts "      end"
      $stderr.puts "    end"
      $stderr.puts
      $stderr.puts '# ' * 40
      $stderr.puts
      $stderr.puts 'error class/message/backtrace:'
      $stderr.puts err.class.name
      $stderr.puts err.message.inspect
      $stderr.puts *err.backtrace
      $stderr.puts err.details if err.respond_to?(:details)
      $stderr.puts
      $stderr.puts 'msg:'
      if msg && msg.is_a?(Hash)
        $stderr.puts msg.select { |k, v|
          %w[ action wfid fei ].include?(k)
        }.inspect
      else
        $stderr.puts msg.inspect
      end
      $stderr.puts
      $stderr.puts '#' * 80

      $stderr.flush
    end
This default implementation dumps error information to $stderr as
 soon as #step intercepts the error.

 Normally such information should only appear when developing a
 storage, the information here is thus helpful for storage developers.
 If such info is emitted in production or in application development,
 you should pass the info to the storage developer/maintainer.

 Feel free to override this method if you need it to output to
 a channel different than $stderr (or rebind $stderr).

 The second parameter is "msg", if the error occured while processing a
 msg, then this message is passed to handle_step_error. msg will be
 nil if the error occurred while doing get_msgs or get_schedules.