package org.talkingpuffin.ui

import org.talkingpuffin.Session
import twitter4j.User
import org.talkingpuffin.util.Loggable

trait ActionProcessor extends Loggable {
  val session: Session
  
  def process[T](items: Seq[T], action: ((T) => Unit), actionName: String, msg: String) =
    items.foreach(item =>
      session.addMessage( 
        try {
          action(item)
          String.format(msg, item.asInstanceOf[Object])
        } catch {
          case e: Throwable => {
            error(e.getMessage)
            "Error " + actionName + " " + item.toString
          }
        }
      )
    )

  def processUsers(items: Seq[String], action: ((String) => User), actionName: String, msg: String) =
    process(items, (name: String) => {action(name)}: Unit, actionName, msg)
  
}
package org.talkingpuffin.ui

import org.talkingpuffin.Session
import twitter4j.User

trait ActionProcessor {
  val session: Session
  
  def process[T](items: Seq[T], action: ((T) => Unit), actionName: String, msg: String) =
    items.foreach(item =>
      session.addMessage( 
        try {
          action(item)
          String.format(msg, item.asInstanceOf[Object])
        } catch {
          case e: Throwable => "Error " + actionName + " " + item.toString
        }
      )
    )

  def processUsers(items: Seq[String], action: ((String) => User), actionName: String, msg: String) =
    process(items, (name: String) => {action(name)}: Unit, actionName, msg)
  
}
--- 
+++ 
@@ -2,8 +2,9 @@
 
 import org.talkingpuffin.Session
 import twitter4j.User
+import org.talkingpuffin.util.Loggable
 
-trait ActionProcessor {
+trait ActionProcessor extends Loggable {
   val session: Session
   
   def process[T](items: Seq[T], action: ((T) => Unit), actionName: String, msg: String) =
@@ -13,7 +14,10 @@
           action(item)
           String.format(msg, item.asInstanceOf[Object])
         } catch {
-          case e: Throwable => "Error " + actionName + " " + item.toString
+          case e: Throwable => {
+            error(e.getMessage)
+            "Error " + actionName + " " + item.toString
+          }
         }
       )
     )
Put more detail into the log for errors
