Google Wave Tips: catching robot exceptions

Almost trivial code, which I found very useful debugging my robots

public void processEvents(RobotMessageBundle bundle) {
   try {
      processEventsInternal(bundle);
   }
   catch (Throwable t) {
      final StringWriter stringWriter = new StringWriter();
      t.printStackTrace(new PrintWriter(stringWriter));
      bundle.getWavelet().getRootBlip().getDocument().append(stringWriter.getBuffer().toString());
   }
}

Leave a Reply

You must be logged in to post a comment.